I have a multi index dataframe with a minute timestamp of 5 minutes interval. I am trying to convert "TimeStamp" column to a "datetimeindex" so I can use this solution here (How do you clean and forward fill a multiple day 1 minute time series with pandas?). My sample data:
2002074266 2002074444
TimeStamp Total Freq Total Freq
HH:MM Pc Hz Pc Hz
06:50 3 10 7 13
06:55 4 11 8 14
07:00 5 12 9 15
Is it possible to do it - I have tried the following code but it does not work.
df['TimeStamp'] = pd.to_datetime(df['TimeStamp'])
df = df.set_index('TimeStamp')
It return KeyError: 'TimeStamp'.
This is the line I use to read my CSV file:
df = pd.read_csv("Equipment.csv", header=[0,1], skiprows = 3, index_col=0)
Any guide/help will be appreciated. Thank you.