제로베이스/데이터분석

[기초노트]// 판다스(pandas).doc로 공부하는 loc (1)

진주네카라 2021. 10. 15. 22:06
728x90

 

 

offset index

  • [n:m] : n부터 m-1 까지
  • 인덱스나 컬럼의 이름으로 slice하는 경우는 끝을 포함

 

loc[ ]

  • location
  • 주로 index 이름으로 특정 행, 열을 선택
  • boolean 배열도 사용 가능하다
    • True 와 False만 존재하는 배열 [True, False, True]

 

 

 


 

공부 글

 

https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.loc.html?highlight=loc#pandas.DataFrame.loc 

 

pandas.DataFrame.loc — pandas 1.3.3 documentation

A slice object with labels, e.g. 'a':'f'. Warning Note that contrary to usual python slices, both the start and the stop are included

pandas.pydata.org

 

img. https://pandas.pydata.org/

728x90