{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "a5211869",
            "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": "58bb7383",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "import numpy as np\nfrom scipy.stats import sigmaclip\na = np.concatenate((np.linspace(9.5, 10.5, 31),\n                    np.linspace(0, 20, 5)))\nfact = 1.5\nc, low, upp = sigmaclip(a, fact, fact)\nc",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([  9.96666667,  10.        ,  10.03333333,  10.        ])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "4de185a0",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "c.var(), c.std()",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "(0.00055555555555555165, 0.023570226039551501)"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "e3b4ac4a",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "low, c.mean() - fact*c.std(), c.min()",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "(9.9646446609406727, 9.9646446609406727, 9.9666666666666668)"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "c84f14a9",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "upp, c.mean() + fact*c.std(), c.max()",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "(10.035355339059327, 10.035355339059327, 10.033333333333333)"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "54504586",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "a = np.concatenate((np.linspace(9.5, 10.5, 11),\n                    np.linspace(-100, -50, 3)))\nc, low, upp = sigmaclip(a, 1.8, 1.8)\n(c == np.linspace(9.5, 10.5, 11)).all()",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "True"
                    },
                    "execution_count": null
                }
            ]
        }
    ]
}