Skip to content
C

Problem 1: Fix Inconsistent Text Formatting

Easypython

Problem Description

Write a Python program that takes a DataFrame column containing names with inconsistent spacing and capitalization, and cleans it into a consistent title-case format with no extra whitespace.

Input

A DataFrame with a "name" column containing inconsistent text.

Output

The cleaned "name" column.

Constraints

  • Assume all values are strings.

Example Input

text
[" aarav", "MEERA ", "kaBIR"]

Example Output

text
["Aarav", "Meera", "Kabir"]

Concepts Covered

.str.strip(), .str.title().

Input (stdin)

Output

Run your code to see output here...