(I am not very familiar with panda too!)
In case of his data he needs to set unit to 's'
df['dt'] = pd.to_datetime(df.epoch,unit='s')
It return utc time from epoch, so maybe this is what he could use ->
df['dt'] = df.epoch.apply(time.ctime)
or something like (if he needs strings) ->
df['dt']
I'm not familar with pandas.
If you look on stackoverfolow you'll find this solution:
df.epoch = pd.to_datetime(df.epoch)
https://stackoverflow.com/questions/17134716/convert-dataframe-column-type-from-string-to-datetime
But in this case, it's not a plain string, then it's a datetime object.
Gr
zljubi...@gmail.com writes:
> I have a dataframe with epoh dates, something like this:
>
> df = pd.DataFrame( { 'epoch' : [1493928008, 1493928067, 1493928127,
> 1493928310, 1493928428, 1493928547]})
>
> I want to create a new column with epoch converted to -mm-dd as string.
"epoch" dates us
I have a dataframe with epoh dates, something like this:
df = pd.DataFrame( { 'epoch' : [1493928008, 1493928067, 1493928127, 1493928310,
1493928428, 1493928547]})
I want to create a new column with epoch converted to -mm-dd as string.
Actually, I have a epoch column, and I would like to us