For use vectorized string methods to extract the year I did this:
cease_pattern = r'(?P<Month>[0-1][0-9]/)?(?P<Year>[1-2][0-9]{3})'
cease_years = dete_resignations['cease_date'].str.extract(cease_pattern,expand=True).copy()
cease_years['Year'] = cease_years['Year'].astype(float)
cease_years.head()
Result:
Add this to the dataframe:
For plot the values:
This result is not product of an error, this plot use science notation:
For plot the bar chart expected you should do this:
use this plt method:
plt.ticklabel_format(useOffset=False, axis='y')