I have a data frame with 3 numerical variables for which I am trying to cap the outliers between 0.01 to 0.99 percentile but it's not working.
df[['TotalVisits', 'Total Time Spent on Website',
'Page Views Per Visit']].describe(percentiles=[.25, .5, .75, .90, .95, .99])
Now I tried to cap the outliers as this:
q_l = df['TotalVisits'].quantile(0.00)
q_h = df['TotalVisits'].quantile(0.99)
df['TotalVisits'][df['TotalVisits']<= q_l] = q_l
df['TotalVisits'][df['TotalVisits']>= q_h] = q_h
But the output remains same instead of max value changing to 17.