0

I have a dataframe that has a column with a TimeStamp. The data in this column is float64

timestamp
1582574539
1582574454
1582573814
1582573499
1582573234

I want to convert this column to DateTime or add a new column with the readable DateTime

DateTime
2/24/20 14:52
2/24/20 14:50
2/24/20 14:46

I tried the following code -

df1['DateTime'] = datetime.fromtimestamp(df1.timestamp)

And got the following errors -

TypeError("cannot convert the series to " "{0}".format(str(converter)))
TypeError: cannot convert the series to <class 'int'>
nafcb10
  • 33
  • 1
  • 5

0 Answers0