{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "d8c79a36",
            "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": "aa67eeb7",
            "cell_type": "markdown",
            "source": "Draw samples from a log-normal distribution:\n",
            "metadata": {}
        },
        {
            "id": "13be0cfe",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "import numpy as np\nfrom scipy.stats import zscore, gzscore\nimport matplotlib.pyplot as plt",
            "outputs": []
        },
        {
            "id": "fc86fee2",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "rng = np.random.default_rng()\nmu, sigma = 3., 1.  # mean and standard deviation\nx = rng.lognormal(mu, sigma, size=500)",
            "outputs": []
        },
        {
            "id": "defbe1cf",
            "cell_type": "markdown",
            "source": "Display the histogram of the samples:\n",
            "metadata": {}
        },
        {
            "id": "9a674367",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "fig, ax = plt.subplots()\nax.hist(x, 50)\nplt.show()",
            "outputs": []
        },
        {
            "id": "cf04317e",
            "cell_type": "markdown",
            "source": "Display the histogram of the samples standardized by the classical zscore.\nDistribution is rescaled but its shape is unchanged.\n",
            "metadata": {}
        },
        {
            "id": "39819358",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "fig, ax = plt.subplots()\nax.hist(zscore(x), 50)\nplt.show()",
            "outputs": []
        },
        {
            "id": "58075094",
            "cell_type": "markdown",
            "source": "Demonstrate that the distribution of geometric zscores is rescaled and\nquasinormal:\n",
            "metadata": {}
        },
        {
            "id": "f536b05d",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "fig, ax = plt.subplots()\nax.hist(gzscore(x), 50)\nplt.show()",
            "outputs": []
        }
    ]
}