Quantile 0.75

Linda97
Linda97 Registered Posts: 4

Hello,

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

Thanks

Tagged:

Answers

  • Shashank
    Shashank Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 27 Dataiker
    edited July 17

    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

  • Linda97
    Linda97 Registered Posts: 4

    Thank you so much

Setup Info
    Tags
      Help me…