I have a pandas dataframe with unix time that gets converted to a timestamp (all fine). I then want to extract the timestamp column - as a list - and retain the information. But for some reason this gets converted back to unix time when I do it (with even more trailing zeros...):
import pandas as pd
data = {'servertime':[1576887840000,1576887900000,1576887960000], 'val':[1,2,3]}
df = pd.DataFrame(data)
df['timestamp'] = df['servertime'].apply(lambda x: datetime.fromtimestamp(x/1000))
t = df['timestamp'].values.tolist()
t
Out[1]: [1576887840000000000, 1576887900000000000, 1576887960000000000]
Any ideas?