numeric_list=[]
categoical_list=[]
for i in df.columns :
if df[i].dtypes == 'O' :
categoical_list.append(i)
else :
numeric_list.append(i)
print("categoical_list :", categoical_list)
print("numeric_list :", numeric_list)
'파이썬. 데이터분석 > Pandas' 카테고리의 다른 글
| [정리] Pandas 전처리 기본 (1) | 2024.09.28 |
|---|---|
| SettingWithCopyWarning 알람 원인, 끄기 (0) | 2024.09.28 |
| 컬럼 값에 따라 조건 변경 if문 없이 (1) | 2024.09.16 |
| type과 dtype 차이 (0) | 2024.07.30 |
| 파이썬 reshape (0) | 2024.07.29 |