본문 바로가기

python

[python] dataframe column 존재하는데도 KeyError

문제

df['column1','column2'] 를 쓰면 KeyError 가 났다

 

해결

df.loc[:,['column1','column2']] 사용