I am on part 5 of the guided project “clean and analyze employee exit survey”. The instruction was to use vectorized string method to extract the year.
Screen Link:
My Code:
dete_resignations['cease_date'] = dete_resignations['cease_date'].str.split('/').str[-1]
What I expected to happen:
I thought this would return a column with just the year.
What actually happened:
<ipython-input-22-69e33acb3bbd>: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: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
dete_resignations['cease_date'] = dete_resignations['cease_date'].str.split('/').str[-1]
I am lost. Please help.