Home>

There is a DataFrame which contains a date in Unixtimestamp .

How to translate a value if they exceed the valid value of standard Pandas functions?

df= pd.dataframe ({'datetime': [96028070400000,10967555200000,1567555200000, -1167555200000]})

tried to_datetime, falls with a mistake:

df ['datetime']= pd.to_datetime (df ['datetime'], unit= 'ms')

tried to_timedelta, incorrectly translates the first element:

df ['datetime']= pd.to_timedelta (df ['datetime'], unit= 'ms') + pd.timestamp ('1970-01-01')

should turn out something like this:

df= pd.dataframe ({'datetime': [5013-01-04,2317-07-20,2019-09-04,1933-01-01]})

And why do you get such values ​​that "roar the permissible value of standard Pandas functions"?

strawdog2021-06-03 13:14:29

Pandasus.Podat.Org /Pandas doks /Stable /Dusty_guide /...

Кирилл Малышев2021-06-03 13:14:29

Well, these values ​​came

meyera34892021-06-03 13:14:29

@ Meyera3489, what to do with the answers to the question?

MaxU2021-06-03 13:14:29