I have a dataframe like the one displayed below:
# Create an example dataframe about a fictional army raw_data = {\'regiment\': [\'Nighthawks\', \'Nighthawk
try this
df2 = df2.apply(lambda x: x.str.upper() if x.dtype == "object" else x)