p = df[df['Name'].str.contains(NER, na = True)]
p['Result'] = p['Result'].astype('float')
p.groupby(["Name"])["Result"].plot(legend=True ,figsize=(15,10))
plt.legend(loc ='upper right')
plt.savefig('figure.png')
plt.close()
How can I turn the Timestamp column into the values of the X axis in the plot
I tried:
p.set_index("Timestamp", inplace=True)
But the x-axis starts from 00:00:00 and not from the time of the first index (09:34:54).
p after the line: p['Result'] = p['Result'].astype('float')
Timestamp Name Result
7 09:34:54 TRX0_NER_M0 1.0
8 09:34:54 TRX0_NER_M1 1.0
9 09:34:54 TRX1_NER_M0 1.0
10 09:34:54 TRX1_NER_M1 1.0
11 09:34:54 TRX2_NER_M0 1.0
... ... ... ...
401465 09:47:00 TRX1_NER_M1 1.0
401466 09:47:00 TRX2_NER_M0 1.0
401467 09:47:00 TRX2_NER_M1 1.0
401468 09:47:00 TRX3_NER_M0 1.0
401469 09:47:01 TRX3_NER_M1 1.0
[38341 rows x 3 columns]