Warning: A value is trying to be set on a copy of a slice from a DataFrame

I need your help on a question tags 348-5

dete_resignation is a subset of the data. I want to clean the cease_date column, but it leads to the following warning/error:

y:1: 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

How should I modify my code in order for it to work?

dete_resignations[‘cease_date’] = dete_resignations.cease_date.str.split("/").str.get(1).astype(float)

1 Like

Hi @LuukvanVliet,

I would recommend you to check out this blog post:

Best,
Sahil

1 Like