import pandas as pd import numpy as np df = pd.read_csv('hr_satisfaction.csv') df.head()
df.isnull().sum()
employee_id 0 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 27 last_evaluation 27 dtype: int64
df.fillna(df.mean(), inplace=True) df.isnull().sum()
employee_id 0 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