I am trying to write a for-loop in python on a pandas dataframe. I want to convert all strings in the color column that have "Green" as their last word (ex. Yellowish Green") to just "Green". Below is my loop:
for color in df['color']:
low = color.split()
if low[-1] == "Green":
color = "Green"
However, this is not changing the actual values in the dataframe.