I have a problem when trying to plot a timeseries with matplotlib:
df = pd.read_csv('myfile.dat', skiprows=1)
#Change data type to datetime
date_format = '%Y-%m-%d %H:%M:%S'
df['TIME'] = pd.to_datetime(df['TIME'], format=date_format)
fig, ax = plt.subplots()
ax.plot(df['TIME'], df['Value'])
plt.show()
If I do:
print(df['TIME'][0])
the output is:
2022-04-16 14:32:00
which is the correct format! But when I plot everything, it changes to:
Can someone help me? I saw several times that you actually do not need Formatter
and all that stuff.