I have a dataframe awith the following column MENU_HINT and im looking to make a new column by picking out the third word:
MENU_HINT
AUS / Cant (AUS)
AUS / Darw (AUS)
AUS / YarV (AUS)
AUS / Goul (AUS)
My code is the following:
splittext = str(dfresults['MENU_HINT'])
dfresults['City'] = splittext.split()[3]
Which Gives Me:
MENU_HINT City
AUS / Cant (AUS) Cant
AUS / Darw (AUS) Cant
AUS / YarV (AUS) Cant
AUS / Goul (AUS) Cant
I'm after Cant, Darw, YarV, Goul but it is fixing on the top value (Cant).
I know I'm close but cant seem to figure out the issue so any help would be great!