I converted a column to index and now I tried to convert it into a date time index. But got the error.
My code:
df.set_index('Time',inplace=True) % This worked perfectly
df.index =
ndex(['5/7/2020 7:01', '5/7/2020 7:02', '5/7/2020 7:03', '5/7/2020 7:04',
'5/7/2020 7:05', '5/7/2020 7:06', '5/7/2020 7:07', '5/7/2020 7:08',
'5/7/2020 7:09', '5/7/2020 7:10',
...
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
dtype='object', name='Time', length=1441)
df.index = pd.to_datetime(df.index)
Present output:
ValueError: ('String does not contain a date:', ' ')