← Quiz: Data Cleaning: all 10 questions
Quiz: Data Cleaning · Question 6 of 10
What does this print? (code)
What does this print?
import pandas as pd
s = pd.Series([" Pune", "PUNE ", "pune", "Jaipur"])
print(s.str.strip().str.title().nunique())
- A.4
- B.3
- C.2
- D.1
Answer & explanation
Correct answer: 2
After trimming and fixing case there are only two cities: Pune and Jaipur.
Can you get the rest right without peeking?
Take the timed Quiz: Data Cleaning quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →