본문 바로가기

Python/Pandas

[Python] Pandas .loc[] 과 .iloc[]

loc: index location (index 이름)

 

iloc: index position (index number)

loc[:3]은 index 이름이 3인 series까지 출력해주고

iloc[:3]은 index number가 3인 series전까지 출력해주는 것을 볼 수 있다.