0

I have the following dataframe:

df

The column Time is a string and I want to convert it either to timestamp or datetime formats. However, when I run df['Time'] = pd.to_datetime(df['Time']), I always get an error

OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 1-01-01 08:53:30
rocker996
  • 113
  • 2
  • 7

1 Answers1

0

Are you sure you are getting the right column and values. Because running

time = pd.to_datetime("13:30:35.805")

Gives

Timestamp('2020-04-20 13:30:35.805000')

as output as expected. If you can't solve the problem with pandas directly you can always manually split the string in hours, minutes and seconds with

h, m, s = map(float, x.split(':'))

And use those values to create a timestamp