Applying uppercase to a column in pandas dataframe

If your version of pandas is a recent version then you can just use the vectorised string method upper:

df['1/2 ID'] = df['1/2 ID'].str.upper()

This method does not work inplace, so the result must be assigned back.

Leave a Comment