VOOZH about

URL: https://www.geeksforgeeks.org/python/apply-uppercase-to-a-column-in-pandas-dataframe/

⇱ Apply uppercase to a column in Pandas dataframe - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Apply uppercase to a column in Pandas dataframe

Last Updated : 3 Oct, 2025

In Pandas, you can easily convert all text in a column to uppercase using either the .str.upper() method or .apply() with a lambda function. This helps standardize text data for analysis or reporting.

Load the DataSet:

To download the dataset used in this article, click here

Use .read_csv() method to load the csv file into a dataframe:

👁 Image

Method 1: Using .str.upper()

Output

👁 Image

Method 2: Using apply() with a lambda function

Output

👁 Image

Explanation:

  • data.dropna(inplace=True): Removes rows with any missing values to avoid errors.
  • data['College'].apply(lambda x: x.upper()): Converts all entries in the 'College' column to uppercase.

Related Articles:

Comment