|
1
2
3
4
5
6
7
|
df_1 = df_0.drop(['Br. Cd. 57, 144', 'Br. Cd. 55', 'Br. Cd. 272',
'Br. Cd. 286', 'Br. Cd. 24', 'Br. Cd. 481', 'Br. Cd. 352', 'Br. Cd. 5',
'Others 999', 'Pr Cat 1', 'Pr Cat 2', 'Pr Cat 3', 'Pr Cat 4',
'PropCat 5', 'PropCat 6', 'PropCat 7', 'PropCat 8', 'PropCat 9',
'PropCat 10', 'PropCat 11', 'PropCat 12', 'PropCat 13', 'PropCat 14',
'PropCat 15'], axis=1, inplace=False)
df_1
|
cs |
기존 데이터 프레임(df_0)에서 위의 열(column)들을 제거한 후, 새로운 데이터 프레임(df_1)에 저장하고 싶었다. 그런데, 자꾸 df_0에서만 드랍이되고 df_1에는 저장이 안 됐는데,
inplace=False로 지정해 주니까 원하는 대로 됐음.
하하하
'배운 것 > Python' 카테고리의 다른 글
| [기초문법] print와 return의 차이 (0) | 2022.01.01 |
|---|---|
| [기초문법] .format() 함수에서 소수점 자릿수 제어하기 (0) | 2021.12.31 |
| [pandas] DataFrame loc[ ] 연산자 - Index(인덱스) (0) | 2021.07.20 |
| [pandas] get_dummies : One-hot encoding(원핫 인코딩) (0) | 2021.07.20 |
| [numpy] numpy.select(conditionlist, choicelist, default=) (0) | 2021.07.20 |