lower method in Pandas

In Pandas, the lower() method is used to convert string values to lowercase. It is accessed through the .str accessor, which provides vectorized string functions for Series (especially useful for string columns in DataFrames).

Syntax df['column_name'].str.lower()

Example:

Python

import pandas as pd

df = pd.DataFrame({
    'City': ['DELHI', 'mumbai', 'ChENNAI']
})

df['City_lower'] = df['City'].str.lower()
print(df) 

The output of the above code is shown below:

lower method in Pandas