Hello Team,
I tried replicating for the same code for a time series data set with 6 columns along with an index columns of DateTime.
import plotly.plotly as py
import plotly.graph_objs as go
import dash
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
df = pd.read_csv('test_data.csv', index_col=0, parse_dates=True).fillna(value = 0)
df.index = pd.to_datetime(df.index)
trace1 = go.scatter(x=df.index, y=df[('BAD1-E7-5 -B500 -ME1')], name='BAD1-E7-5 -B500 -ME1')
trace2 = go.scatter(x=df.index, y=df[('BAD1-E7-5 -B500 -ME2')], name='BAD1-E7-5 -B500 -ME2')
trace3 = go.scatter(x=df.index, y=df[('BAD1-E7-5 -B500 -ME3')], name='BAD1-E7-5 -B500 -ME3')
trace4 = go.scatter(x=df.index, y=df[('BAD1-E7-5 -B500 -ME4')], name='BAD1-E7-5 -B500 -ME4')
trace5 = go.scatter(x=df.index, y=df[('BAD1-E7-5 -B500 -ME5')], name='BAD1-E7-5 -B500 -ME5')
trace6 = go.scatter(x=df.index, y=df[('BAD1-E7-5 -B501 -ME1')], name='BAD1-E7-5 -B501 -ME1')
data = [trace1,trace2,trace3,trace4,trace5,trace6]
layout = dict(
title='Time Series of sensor df_n_light with Rangeslider',
xaxis=dict(
rangeselector=dict(
buttons=list([
dict(count=1,
label='1m',
step='month',
stepmode='backward'),
dict(count=6,
label='6m',
step='month',
stepmode='backward'),
dict(step='all')
])
),
rangeslider=dict(),
type='date'
)
)
fig = dict(data=data, layout=layout)
# Now here's the Dash part:
dash.layout = html.Div([
dcc.Graph(id='my-graph', figure=fig)
])
I am getting an error with this code, could you please guide me why i am getting the below error message?
Traceback (most recent call last):
File “C:\Users\Monisha\Desktop\dash_sensor.py”, line 7, in
import plotly.plotly as py
File “C:\Users\Monisha\anaconda3\lib\site-packages\plotly\plotly_init_.py”, line 4, in
_chart_studio_error(“plotly”)
File “C:\Users\Monisha\anaconda3\lib\site-packages_plotly_future__init_.py”, line 43, in _chart_studio_error
raise ImportError(
ImportError:
The plotly.plotly module is deprecated,
please install the chart-studio package and use the
chart_studio.plotly module instead.