[Python] ValueError: Plan shapes are not aligned df_concat = pd.concat([df1, df2]) ValueError: Plan shapes are not aligned 데이터프레임 df1, df2 둘 중에 컬럼명이 중복된 것이 있을 것입니다 df1.columns.duplicated() # 컬럼 중복 확인! columns => ['A', 'B', 'A', 'C'] 같은 경우입니다. 컬럼명 중복을 해결하신 후 다시 pd.concat( )을 하면 해결됩니다~ 데이터 분석/[Python] Troubleshooting 2021.08.19
[Python] astype 컬럼타입 변경시 결측 에러 무시 위 데이터처럼 일부 결측이 있을 경우 숫자형 타입을 바꿀 때 다음과 같이 에러가 납니다. df['실거래_거래금액(만원)'] = df['실거래_거래금액(만원)'].astype(int) ValueError: invalid literal for int() with base 10: 'nan' 아래와 같이 해결할 수 있습니다! df['실거래_거래금액(만원)'] = df['실거래_거래금액(만원)'].apply(pd.to_numeric, errors='coerce') 데이터 분석/[Python] 기초 2021.08.19