I have a dataframe that I want to build using matplotlib, but the index column is the time, and I cannot build it.
This is dataframe (df3):

but when I try the following:
plt.plot(df3['magnetic_mag mean'], df3['YYYY-MO-DD HH-MI-SS_SSS'], label='FDI')
I get an error message:
KeyError: 'YYYY-MO-DD HH-MI-SS_SSS'
So what I want to do is add a new extra column to my framework (named "Time"), which is just a copy of the index column.
How can i do this?
This is all the code:
#Importing the csv file into df df = pd.read_csv('university2.csv', sep=";", skiprows=1)
Thanks!
source share