해결된 질문
작성
·
19
0
데이터 결측치 전처리 하는데
이렇게 코드 작업을 했더니 워닝 메시지가 뜨는데
시험환경에서도 수정이 필요할까요?
# 데이터 전처리 _ 결측치 대체 df['fuel_type'].fillna(df['fuel_type'].mode()[0], inplace = True) df['accident'].fillna(df['accident'].mode()[0], inplace = True) df['clean_title'].fillna(df['clean_title'].mode()[0], inplace = True)
[워닝메시지]
<ipython-input-37-b2145d16d236>:15: FutureWarning: A value is trying to be set on a copy of a DataFrame or Series through chained assignment using an inplace method. The behavior will change in pandas 3.0. This inplace method will never work because the intermediate object on which we are setting values always behaves as a copy. For example, when doing 'df[col].method(value, inplace=True)', try using 'df.method({col: value}, inplace=True)' or df[col] = df[col].method(value) instead, to perform the operation inplace on the original object. df['fuel_type'].fillna(df['fuel_type'].mode()[0], inplace = True)