0

There was a thread here discussing why and how to deal with this. But it was 7 years ago. I am using Python 3.9, pandas 1.3.3. I want to modify a column timestamp in my data frame as following:

df['timestamp'] = df['timestamp'].map(lambda ts: some_func(ts))

I got the same warning. So I tried these solutions:

df.loc[:, 'timestamp'] = df['timestamp'].map(lambda ts: some_func(ts))
df['timestamp'] = df.loc[:, 'timestamp'].map(lambda ts: some_func(ts))

But both of them still give the same warning. If I don't want to suppress the warning and instead solve it properly, how should I revise this line of code?

Tristan Tran
  • 1,351
  • 1
  • 10
  • 36

0 Answers0