I have a pandas dataframe with a timestamp column plus other variables. Some of these variables are NaN which I desire to median impute using a condition. The condition is: