I have a DataFrame with a column which has a time represented as a unix timestamp. I would like to parse the whole column to represent time as datetime (year-month-day-hours-minute-second). I did it using the foor loop but it takes a long time for large DataFrame
. Can I speed this up or maybe is there some built-in Pandas function which I can use instead?
for idx, row in df.iterrows():
df.loc[idx, "time"] = pd.to_datetime(row['time'], unit='s')