Quantile 0.75
Linda97
Registered Posts: 4 ✭
Hello,
I want to fill missing value of a column with Quantile 0.75.
Thanks
Tagged:
Answers
-
Shashank Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 28 Dataiker
Need to use Python Recipe to Impute the values with quantile 0.75:
Use numpy to calculate the quantile and then fill NA with the value
import pandas as pd, numpy as np quat75 = np.quantile(df.<col_name>.notnull(),.75) newDf = pd.DataFrame(df.<col_name>.fillna(quat75))
Merge the newDF with the original Df and write it in output dataset
-
Thank you so much