loc: index location (index 이름)
iloc: index position (index number)
예
loc[:3]은 index 이름이 3인 series까지 출력해주고
iloc[:3]은 index number가 3인 series전까지 출력해주는 것을 볼 수 있다.
'Python > Pandas' 카테고리의 다른 글
MySQL에 np.nan을 갖는 pandas.DataFrame 삽입하기 (0) | 2021.10.01 |
---|---|
[부스트코스] [머신러닝을 위한 파이썬] Pandas Selection & Drop (0) | 2021.01.16 |
Pandas (0) | 2020.07.25 |