I am trying to write a function which takes a pandas dataframe of milliseconds data and converts it into datetime. However i am getting an error by name : AttributeError: 'numpy.int64' object has no attribute 'iat'
Now i have searched that .iat call is used to access element inside a pandas dataframe .
Dataframe consists of the following :
Time
1561912331018.00
1561912721486.00
1561977388732.00
1561899755951.00
1561897193639.00
1561982246953.00
1561977096883.00
1561919518921.00
1561942255704.00
1561939827253.00
1561965861054.00
1561960122342.00
1561949100949.00
1561962949812.00
def epoch_converter(data):
for number , row_value in data.iteritems():
number = data.loc[number].iat[0]
import datetime
number = number / 1000.0
val = datetime.datetime.fromtimestamp(number).strftime('%Y-%m-%d %H:%M:%S.%f')
print(val)
epoch_converter(time_val.Time)