I have the following list of epoch timestamps in a column in my df
which is df['DateTime']
(Note they dont have []
in the actual column:
[1.59549158e+12]
[1.59549322e+12]
[1.59549322e+12]
[1.59549322e+12]
[1.59549322e+12]
[1.59549522e+12]
[1.59549685e+12]
[1.59549685e+12]
[1.59549685e+12]
[1.59549784e+12]
[1.59549784e+12]
[1.59549871e+12]
[1.59549969e+12]
[1.59549969e+12]
[1.59556182e+12]
[1.59556182e+12]
[1.59556661e+12]
[1.59556661e+12]
[1.59556661e+12]
[1.59556661e+12]
[1.59556833e+12]
[1.59556939e+12]
[1.59557079e+12]
[1.59557079e+12]
[1.59557246e+12]
[1.59557246e+12]
[1.59557335e+12]
[1.59557335e+12]
[1.59557335e+12]
[1.59557564e+12]
[1.59557564e+12]
[1.59557564e+12]
[1.59557603e+12]
[1.59557603e+12]
Looking through the documentation and on StackOverflow I have tried the following code to convert those into a timestamp:
df['Date'] = pd.to_datetime(df['DateTime'],unit='s')
But I am getting an error saying
OverflowError: int too big to convert
and also
pandas._libs.tslibs.np_datetime.OutOfBoundsDatetime: cannot convert input 1595482694074.0 with the unit 's'
Does anyone know what these errors mean and how to get around it. It says int too big to convert
but as a data type it is a float64
. I am trying to convert to an Australian timezone ideally. If anyone has any ideas that would be great! Thanks very much!