We are complementing the missing value of application_{train|test}.csv in the kaggle Home Credit Default Risk.
I would like to fill the following two characteristics with the average value, but mean() returns to nan.
Feature
'YEARS_BUILD_AVG'
'YEARS_BEGINEXPLUATION_AVG'
print(train['YEARS_BUILD_AVG'].mean())
>>nan
I look forward to your kind cooperation.
python pandas
data['YEARS_BUILD_AVG'].filna(data['YEARS_BUILD_AVG'].mean())
Will it work?
© 2024 OneMinuteCode. All rights reserved.