- Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathSimpleLinechart.py
More file actions
Latest commit
23 lines (17 loc) · 526 Bytes
/
Copy pathSimpleLinechart.py
File metadata and controls
23 lines (17 loc) · 526 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
importpandasaspd
importplotly
importplotly.graph_objsasgo
fromplotly.offlineimport*
# To initiate ploty to run offline
init_notebook_mode(connected=True)
# Import data
df=pd.read_csv('../Data/cust_num.csv')
df=df[df['day']=='Monday']
# Data
data= []
data.append(go.Scatter(x=df['hour'], y=df['customers_count'],
mode='lines'))
# Layout
layout= {'title':{'text':'Number of Customer Trend', 'x':0.5}}
fig=go.Figure(data=data, layout=layout)
plotly.offline.plot(fig, filename='simple_linechart.html')