🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: pandas Basics: all 10 questions

Quiz: pandas Basics · Question 2 of 10

Which filter is correct for CGPA ≥ 7.5 AND no backlogs?

Which filter is correct for CGPA ≥ 7.5 AND no backlogs?

  1. A.df[df.cgpa >= 7.5 and df.backlogs == 0]
  2. B.df[(df["cgpa"] >= 7.5) & (df["backlogs"] == 0)]
  3. C.df[df["cgpa"] >= 7.5 & df["backlogs"] == 0]
  4. D.df.filter(cgpa>=7.5, backlogs=0)
Answer & explanation

Correct answer: df[(df["cgpa"] >= 7.5) & (df["backlogs"] == 0)]

Use & with brackets around each condition.

Can you get the rest right without peeking?

Take the timed Quiz: pandas Basics quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →