Py.Cafe

Cycling Heatmap for Location 100053209

DocsPricing
  • app.py
  • csv2.csv
  • requirements.txt
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# check out https://dash.plotly.com/ for documentation
# And check out https://py.cafe/maartenbreddels for more examples
from dash import Dash, Input, Output, callback, dcc, html
import plotly.express as px
import pandas as pd 

df = pd.read_csv("csv2.csv")
df_unique_location = df[df['id_compteur']==100053209]
hourly_unique_compteurs = df_unique_location.groupby('heure')['nb_passages'].sum()
hourly_unique_compteurs_df = hourly_unique_compteurs.reset_index()

print(hourly_unique_compteurs)
fig = px.histogram(hourly_unique_compteurs_df, x='heure', y='nb_passages', 
title='Number of bicycles in location: 100053209')


app = Dash(__name__)
app.layout = html.Div(
    children=[
        dcc.Graph(figure=fig),
    ]
)