I have a DataFrame with epoch timestamp and I want to create a new column with a formatted date string.
index timestamp
0 1456407930
1 1456407945
2 1456407961
3 1456407977
4 1456407992
5 1456408008
6 1456408024
7 1456408040
8 1456408055
9 1456408071
10 1456408087
11 1456408102
First, I successfully convert the timestamp to datetime format using
data['date_num'] = mdate.epoch2num(data['timestamp'])
But I didn't find a function to get a new column with a string formatted date (such as “%Y-%m-%d”)
.
I would appreciate any ideas? Patricio