main_df[main_df.isnull()].count()
result:
number_project 0
average_montly_hours 0
time_spend_company 0
Work_accident 0
left 0
promotion_last_5years 0
department 0
salary 0
satisfaction_level 0
last_evaluation 0
dtype: int64
however, when I used any() method , I found some null value in my columns
main_df.isnull().any()
results:
number_project False
average_montly_hours False
time_spend_company False
Work_accident False
left False
promotion_last_5years False
department False
salary False
satisfaction_level True
last_evaluation True
dtype: bool
why have this situation?
by the way, I also try the sum(), the result was 0.0 as well, and then
main_df[main_df['employee_id'] == 3794]
result is
18 3794 2 160 3 1 1 1 sales low NaN NaN
however, when I checked by column name
main_df[main_df['satisfaction_level'] == np.nan]
NO any output!
main_df[main_df['satisfaction_level'] == np.nan]tomain_df[main_df['satisfaction_level'].isna()]anything == np.nan always returns False. Even 'np.nan == np.nan` returns False that is not a good check.main_df[main_df.isnull()].count()if I wanna check the whole dataframe