import pandas as pd
import folium
import json
with open("data/omaha/coords.json", "r") as f:
= json.load(f) coords
type(coords)
dict
= folium.Map(location=[41.256538, -95.934502], zoom_start=13)
mymap
# Add markers for each coordinate
for kiosk, coord in coords.items():
= map(float, coord.split(','))
lat, lon =kiosk).add_to(mymap)
folium.Marker([lat, lon], popup
mymap
Make this Notebook Trusted to load map: File -> Trust Notebook
= pd.read_csv("data/omaha/OMA_Bike_Trips_wt_avg_time_bin.csv") df
=['Total_Trips'], ascending=False, inplace=True) df.sort_values(by
import plotly.express as px
= pd.read_csv("data/omaha/OMA_Bike_Trips_wt_avg_time_bin.csv")
df
# Sort the DataFrame by 'Total_Trips' column
= df.sort_values(by='Total_Trips', ascending=False)
df_sorted
# Select the top 15 rows
= df_sorted.head(20)
top_kiosks
# Plot using Plotly
= px.bar(top_kiosks, x='Checkout_Kiosk_Coordinates', y='Total_Trips', title='Most used Kiosk Locations')
fig
# rename the x-axis label
='Checkout Kiosk Address')
fig.update_xaxes(title_text
# rename the y-axis label
='Total Trips')
fig.update_yaxes(title_text
# change the angle of the x-axis labels
=-45)
fig.update_layout(xaxis_tickangle
fig.show()
Unable to display output for mime type(s): application/vnd.plotly.v1+json