1. Home
  2. Data Science
  3. Pandas
  4. The main difference between loc and iloc is that:

Added 30 Nov -0001

The main difference between loc and iloc is that:

  1. loc works only on Series
  2. iloc cannot select rows
  3. loc uses labels while iloc uses integer positions Correct answer
  4. loc uses positions while iloc uses labels

Correct answer

C. loc uses labels while iloc uses integer positions

13 views

MCQSEXAM

Explanation

loc selects by index label; iloc selects by integer position.

Reference

Asked in: NTS, PPSC IT, Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Pandas MCQs

Practise all Pandas MCQs

Similar MCQs