pandas convert all string columns to lowercase

df = df.applymap(lambda s:s.lower() if type(s) == str else s)

Here is what the above code is Doing:
1. We’re using the applymap() method to apply a function to every element in the dataframe.
2. The function we’re applying is a lambda function that converts a string to lowercase.
3. If the element is not a string, the lambda function just returns the element.