I have a data frame and I am trying to convert the time column into a datetime format. The first step I did was:
data['time'] = data.time
data['time']=pd.to_datetime(data['time'], format='%H:%M:%S.%f')
This helped me successfully change the time column to:
dtype('\<M8\[ns\]')
But this gave me "1900-01-01" in every cell. My idea is to extract the time part from it by:
data['time']=data['time'].dt.time
That kind of works as well but the type got changed back to:
dtype('O')
Is there any way I can fix this?