Jun-19-2018, 12:51 PM
I am very new to python, need to develop some dash,
I have a padas dataframe.
df:
x y1 y2
1 4 2
2 1 4
3 5 5
My question is how to use df to replace the hard coded 'data' part in following codes?
Jeff
I have a padas dataframe.
df:
x y1 y2
1 4 2
2 1 4
3 5 5
My question is how to use df to replace the hard coded 'data' part in following codes?
dcc.Graph( id='example-graph', figure={ 'data': [ {'x': [1, 2, 3], 'y': [4, 1, 5], 'type': 'line', 'name': 'SF'}, {'x': [1, 2, 3], 'y': [2, 4, 5], 'type': 'line', 'name': u'Montréal'}, ], 'layout': { 'title': ' Campaign Contacts ' } } )Thanks,
Jeff