https://app.dataquest.io/m/348/guided-project%3A-clean-and-analyze-employee-exit-surveys/5/verify-the-data

Hi, i need some help with my code:

dete_resignations[‘cease_date’] = dete_resignations[‘cease_date’].str.split(’/’).str[-1].copy()

Even when i added the copy method i get this error:

/dataquest/system/env/python3/lib/python3.4/site-packages/ipykernel/main.py: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

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
if name == ‘main’:

So , i am stock in there. Pls help me !
Thanks

Hi @silvinajusid

The problem is that you are saving the copy of the dataframe inside the original dataframe wich is ilogic.

So the best way to answer that is by copying the df before and then use the copy to modify and find the solution to the question, something like this:

dete_resignations_copy = dete_resignations.copy()
dete_resignations_copy['cease_date'] = dete_resignations_copy['cease_date'].str.split('/).str[-1].copy()

Hope this was helpful, good luck

I’t worked! thak you :-))