Screen Link: https://app.dataquest.io/m/346/working-with-strings-in-pandas/2/using-apply-to-transform-strings
Your Code: ```def extract_last_word(element):
return element.str.split()[-1]
merged[‘Currency Apply’] = merged[‘CurrencyUnit’].apply(extract_last_word)
What I expected to happen: To split the string values for the Series 'element' in the function i.e for the merged['CurrencyUnit'] Series.
What actually happened: Error message: ```AttributeError: 'str' object has no attribute 'str'```
Other details: On running merged['CurrencyUnit'].str.split() it perfectly splits the values into a list. But gives error in the map() function.