Reputation: 829
I have a multi indexed file with values such as these
How could I plot a dataframe that has separate lines for each symbol in the same graph?
Upvotes: 0
Views: 49
Reputation: 863611
I believe you need pivot
for all unique symbol
values :
df1 = df.pivot(index='4.timestamp', columns='1.symbol', values='2.price')
If possible duplicated is becessary aggregate by DataFrame.pivot_table
:
df1 = df.pivot_table(index='4.timestamp', columns='1.symbol', values='2.price', aggfunc='mean')
and then plot by DataFrame.plot
:
df1.plot()
Upvotes: 1