📝파이썬 판다스 데이터프레임 행, 열 삭제하기
df.drop('인덱스 or 컬럼' , axis= ) : 삭제하고 싶은 인덱스나 컬럼을 입력하고 axis= 0, 혹은 1을 입력한다
※ axis=0 : 행 / axis=1 : 열
>>> df.drop('인덱스', axis= 0 )
>>> df.drop('컬럼', axis= 1 )
'Python > Pandas' 카테고리의 다른 글
[Python] Pandas xls 파일 불러오기 pd.read_excel() (0) | 2022.11.29 |
---|---|
[Python] Pandas DataFrame 변경, 추가하기 (0) | 2022.11.25 |
[Python] Pandas DataFrame 인덱스, 컬럼명 변경하기 rename() (0) | 2022.11.25 |
[Python] Pandas DataFrame 인덱스 변경, 초기화 set_index(), reset_index() (0) | 2022.11.25 |
[Python] Pandas DataFrame 데이터 확인하기 head(), tail(), describe(), shape, columns, info() (0) | 2022.11.25 |
댓글