{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "c97a2e60",
            "cell_type": "markdown",
            "source": "<div class='alert alert-warning'>\n\nSciPy's interactive examples with Jupyterlite are experimental and may not always work as expected. Execution of cells containing imports may result in large downloads (up to 60MB of content for the first import from SciPy). Load times when importing from SciPy may take roughly 10-20 seconds. If you notice any problems, feel free to open an [issue](https://github.com/scipy/scipy/issues/new/choose).\n\n</div>",
            "metadata": {}
        },
        {
            "id": "12167cb5",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "import numpy as np\nfrom scipy.stats.mstats import winsorize",
            "outputs": []
        },
        {
            "id": "cc61599b",
            "cell_type": "markdown",
            "source": "A shuffled array contains integers from 1 to 10.\n",
            "metadata": {}
        },
        {
            "id": "37ad78c4",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "a = np.array([10, 4, 9, 8, 5, 3, 7, 2, 1, 6])",
            "outputs": []
        },
        {
            "id": "a582645e",
            "cell_type": "markdown",
            "source": "The 10% of the lowest value (i.e., ``1``) and the 20% of the highest\nvalues (i.e., ``9`` and ``10``) are replaced.\n",
            "metadata": {}
        },
        {
            "id": "3b96c681",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "winsorize(a, limits=[0.1, 0.2])",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "masked_array(data=[8, 4, 8, 8, 5, 3, 7, 2, 2, 6],\n             mask=False,\n       fill_value=999999)"
                    },
                    "execution_count": null
                }
            ]
        }
    ]
}