-
[Pandas] IndexingError: Unalignable boolean Series provided as indexer (index of the boolean Series and of the indexed object do not match). 해결법AI, DataScience 2023. 8. 24. 18:09728x90
loc로 데이터프레임의 일부 행만 추출하려고 할 때 발생했다. 왜 이럴까?
그것은 바로, 데이터프레임의 결측값이 있기 때문이다.
df.isnull().sum()
으로 결측값의 개수를 출력하면, 모든 칼럼에 결측값이 있다는 것을 알 수 있다.
그래서
df.dropna(inplace=True)
으로 결측값을 제거하면 오류를 해결할 수 있다.
728x90'AI, DataScience' 카테고리의 다른 글
SHAP Value란 무엇인가? (0) 2023.09.18 음성 신호와 DCGAN | 대한민국 입시의 현실 (0) 2023.09.14 [논문 리뷰] Improving Imbalanced Classification by Anomaly Detection (0) 2023.08.22 [NumPy] np.all, np.any 실전 사용예시 (0) 2023.06.26 ChatGPT 탈옥 : AntiGPT 체험기 (0) 2023.03.28