I am getting the famous
'SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead'
Error when trying to convert a hexadecimal timestamp column to datetime format.
Here is the code that produced the error:
df.loc[:, 'time']=df['time'].apply(lambda x:datetime.datetime.fromtimestamp(int(x,16)))
also
df['time'] = df['time'].apply(lambda x: datetime.datetime.fromtimestamp(int(x,16)))
an example timestamp I am trying to converted is '5d856af7'
Is there any way to perform this operation without a warning. Other code snippets i have tried without success are:
df['time'] = pd.to_datetime(df['time']).apply(lambda x: int(x,16)))
df['time'] = pd.to_datetime(df['time']).apply(lambda x: int(x,16)))
Any help much appreciated
Thanks!