runtime
427 / 500
question 427 pandas Transformations · medium

Tidy a customer export

Write tidy_customers(customers): return a new DataFrame where email is stripped and lower-cased, city is stripped and title-cased, state is stripped and upper-cased, and only the last row of each customer_id remains (later rows are newer). Keep the remaining rows in their original order. The caller's DataFrame must not change.

Functiontidy_customers(customers)
customersa DataFrame with customer_id, email, city, state
Returnsa new DataFrame with the same columns

Loading your progress…

Tidy a customer export — Python practice · Runtime