{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "16c3db5f",
            "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": "a8b38466",
            "cell_type": "markdown",
            "source": "Find the geometric standard deviation of a log-normally distributed sample.\nNote that the standard deviation of the distribution is one; on a\nlog scale this evaluates to approximately ``exp(1)``.\n",
            "metadata": {}
        },
        {
            "id": "dedc496a",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "import numpy as np\nfrom scipy.stats import gstd\nrng = np.random.default_rng()\nsample = rng.lognormal(mean=0, sigma=1, size=1000)\ngstd(sample)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "2.810010162475324"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "dba417d1",
            "cell_type": "markdown",
            "source": "Compute the geometric standard deviation of a multidimensional array and\nof a given axis.\n",
            "metadata": {}
        },
        {
            "id": "ed02b479",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "a = np.arange(1, 25).reshape(2, 3, 4)\ngstd(a, axis=None)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "2.2944076136018947"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "97e42572",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "gstd(a, axis=2)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([[1.82424757, 1.22436866, 1.13183117],\n       [1.09348306, 1.07244798, 1.05914985]])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "f67fcc7c",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "gstd(a, axis=(1,2))",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([2.12939215, 1.22120169])"
                    },
                    "execution_count": null
                }
            ]
        }
    ]
}