SpinTheMic
Pro

Interview practice question

Cleaning and combining name columns

Data Analyst · Python and Pandas · Beginner

First and last names have inconsistent spacing and capitalisation. How would you create a clean full name column in pandas?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • str.strip() to remove spaces.
  • str.title() for capitalisation (with caveats).
  • Combine with + " " +.
  • fillna("") before combining.
  • Collapse internal spaces with regex.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics