Hi All!
I am sure that my code is correct, but why the error still shows up? thank you!!
Screen Link: https://app.dataquest.io/m/348/guided-project%3A-clean-and-analyze-employee-exit-surveys/11/next-steps
My Code:
# Extract the years and convert them to a float type
dete_resignations['cease_date'] = dete_resignations['cease_date'].str.split('/').str[-1]
dete_resignations['cease_date'] = dete_resignations['cease_date'].astype("float")
# Check the values again and look for outliers
dete_resignations['cease_date'].value_counts()
What I expected to happen:
What actually happened:
AttributeError: Can only use .str accessor with string values, which use np.object_ dtype in pandas