Outliers are unusual values in your dataset, and they can distort statistical analyses. If you want to trim values that the outliers, one of the methods is to use df.clip
.
Above is how to use the 0.5-quantile as the lower threshold and .95-quantile as the upper threshold