← Quiz: pandas Basics: all 10 questions
Quiz: pandas Basics · Question 1 of 10
What is the difference between loc and iloc?
What is the difference between loc and iloc?
- A.loc selects by labels; iloc selects by integer positions
- B.loc is for rows, iloc for columns
- C.iloc is faster but loc is deprecated
- D.There is no difference
Answer & explanation
Correct answer: loc selects by labels; iloc selects by integer positions
They only look alike with a default 0, 1, 2… index.
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 →