Here's my data
id enter_time
1 1.481044e+12
2 1.486d74e+12
Here's my expected output
id enter_time enter_timestamp
1 1.481044e+12 2017-07-14 08:10:03
2 1.486774e+12 2017-07-15 08:10:00
Note: value in "enter_timestamp" in expectation above is false in value, it's only for give idea about expected format, below is additional information just in case needed for answer
In : main['enter_time'].dtype
Out: dtype('float64')
What I already try
import datetime
main['loan_timestamp'] = datetime.datetime.fromtimestamp(main['loan_time'])
and the output
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-27-cfe2d514debb> in <module>
1 import datetime
----> 2 main['loan_timestamp'] = datetime.datetime.fromtimestamp(main['loan_time'])
/opt/conda/lib/python3.8/site-packages/pandas/core/series.py in wrapper(self)
127 if len(self) == 1:
128 return converter(self.iloc[0])
--> 129 raise TypeError(f"cannot convert the series to {converter}")
130
131 wrapper.__name__ = f"__{converter.__name__}__"
TypeError: cannot convert the series to <class 'int'>