I want to show some data using plots. My dataframe has 3 columns,
Id Round Time
1 1 158
1 2 169
1 3 172
2 1 156
2 2 168
2 3 176
With this example what I want to do is show 2 lines in my plot (with different colors), each line must correspond to the id, the x axis with the number of the round and the y axis with time.
Now I'm doing this and it's obviously wrong,
import pandas as pd
data = [[1,1,158],[1,2,169],[1,3,172],
[2,1,156],[2,2,168],[2,3,176]]
cols = ['Id','Round','Time']
df = pd.DataFrame(data, columns=cols)
df.plot(kind='line',x='Round',y='Time')
plt.show()
How can I differentiate each of the different ids?
Thank you very much!!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.