데이터분석/전처리

[판다스 데이터프레임] 특정 컬럼 제외하기

씩씩한 IT블로그 2021. 5. 6. 12:23
반응형

dataFrame에서 특정 column만을 제외하고싶으면 아래와 같이 코드를 구현하면 된다.

df.loc[:, [col for col in df.columns if col != "제외할 칼럼"]]

 

<example>

df

 

df.loc[:, [col for col in df.columns if col != 'temp_group']]

반응형