Here I need to Impute Numeric Columns in pandas
Sample Data:
Age Time_of_service
42 4
24 5
nan 27
26 4
31 5
54 21
21 2
Nan 32
45 18
19 0
65 35
nan 3
Here Both Age & Time_of_Service columns are highly correlated. Based on below Conditions I need to impute the missing Values
Time_of_Service >30
age = 60
Time_of_Service in (20,30)
age = 45
Time_of_Service in (10,20)
age = 35
Time_of_Service in (0,10)
age = 25
How to impute missing values based on above conditions using Python ?