Discover all of the brand-new features and improvements to existing capabilities in the Dataiku 11.3 updateLET'S GO

Quantile 0.75

Linda97
Level 2
Quantile 0.75

Hello,

I want to fill missing value of a column with Quantile 0.75.

Thanks

0 Kudos
2 Replies
shashank
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 

0 Kudos
Linda97
Level 2
Author

Thank you so much