I have the pandas data frame with the column designated to town names. After each town name, I am adding a word "NSW" (e.g. "Sydney" will become "Sydney NSW"). However, this means even when the town already has NSW written, a script will add it again (e.g. "Narara NSW" will become "Narara NSW NSW"). How can I check if a name already has NSW and only add the string if NSW is not present? Here is my code so far:
#Adds "NSW" to the end of each town in the data frame and then adds these changes to to the csv
df['FullAddress'] = df['FullAddress'] + ' NSW'
print(df)
df.to_csv('latLongTest.csv', index=False)
Select the correct answer from above options