SpinTheMic
Pro

Explain it in 60 seconds

loc vs iloc

Data Analyst · Python and Pandas · Beginner

What is the difference between loc and iloc in pandas?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • loc: label-based selection.
  • iloc: position-based selection.
  • loc slices include end label.
  • iloc slices exclude end.
  • Use loc with boolean masks.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics