convert epoch time to date python pandas

Solutions on MaxInterview for convert epoch time to date python pandas by the best coders in the world

showing results for - "convert epoch time to date python pandas"
Jennie
01 Aug 2020
1import pandas as pd
2df = pd.DataFrame({1349876543,1349865757,1349867849,1349880000}, columns={"epoch_time"})
3df
4   epoch_time
50  1349880000
61  1349867849
72  1349865757
83  1349876543
9
10df["date_time"] = pd.to_datetime(df["epoch_time"], unit='s')
11df
12   epoch_time           date_time
130  1349880000 2012-10-10 14:40:00
141  1349867849 2012-10-10 11:17:29
152  1349865757 2012-10-10 10:42:37
163  1349876543 2012-10-10 13:42:23