forked from pythonhealthdatascience/stars-streamlit-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutility.py
More file actions
23 lines (20 loc) · 674 Bytes
/
utility.py
File metadata and controls
23 lines (20 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import plotly.express as px
import pandas as pd
################################################################################
# MODIFICATION v3: code to create plotly histogram
def get_arrival_chart():
'''
Create and return a plotly express bar chart of
arrivals
Returns:
--------
plotly figure.
'''
arrivals = pd.read_csv(md.NSPP_PATH)
fig = px.bar(arrivals, x='period', y='arrival_rate',
labels={
"period": "hour of day",
"arrival_rate": "mean arrivals"
})
return fig
################################################################################