Winsorizing
Winsorizing is the method to replace extreme values with smaller absolute values. It orders the non-null values in numeric columns, computes the tail values, and then substitutes the tail values by the defined parameter.
We can use the winsorize method from the SciPy package to deal with outliers. SciPy is a Python library that is a collection of open source Python contributions on the scientific and technical computing space. It has an extensive collection of statistical computation modules, linear algebra, optimization, signal and image processing modules, and many more modules.
Once we import the winsorize method, we are required to pass the data and the limit parameters to the function. The computations and substitution of ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access