딥러닝에서는 주로 excel이나 csv로 저장된 데이터로부터 label과 같은 정보를 불러오기 위해 pandas 패키지가 쓰인다. pandas의 모든 기능을 알아보기보다는 자주 쓰였던 기능만 기록해 보려고 한다. 

 

pandas 공식 document를 참고하면 더욱 정확하고 많은 정보를 볼 수 있다. 

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.loc.html

 

pandas.DataFrame.loc — pandas 1.2.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

 

데이터 읽기

 

특정 column 선택하기

 

특정 row 선택하기

 

특정 row, column에 해당하는 data 추출

 

특정 column을 row index로 바꾸기

 

특정 row를 숫자로 선택하기

 

기회가 된다면 loc, iloc을 제외하고 많이 사용되는 문법도 추가하도록 하겠다. 

'Python' 카테고리의 다른 글

Argparse, python 기반의 명령형 인터페이스 라이브러리  (0) 2020.04.22

+ Recent posts