🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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())
  1. A.4
  2. B.3
  3. C.2
  4. 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 →