-
[pandas] DataFame 열 기준으로 중복행 제거하기pandas & numpy 2019. 9. 2. 15:11
python code script - df.drop_duplicates(['원하는 기준 열 이름'])을 입력해주면 된다.
*keep : 중복행을 찾았을 때 first는 앞 데이터를 남기며, last는 뒷 데이터를 남긴다.
keep option에는 'first' 또는 'last' 2가지가 있으며, default는 'first' 로 설정되어 있다.
'pandas & numpy' 카테고리의 다른 글
[Matplotlib] Top50개 Basic Examples with Python code (0) 2020.01.21 [pandas]Dataframe 열(column) 삭제 (0) 2020.01.13 [pandas] DataFrame 원하는 컬럼 추출, astype(),groupby() 사용하기 (0) 2019.05.10