{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "d9083cbe",
            "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": "7c2cfb9a",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "from scipy.spatial import distance\nimport numpy as np\ndistance.jensenshannon([1.0, 0.0, 0.0], [0.0, 1.0, 0.0], 2.0)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "1.0"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "9372a20c",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "distance.jensenshannon([1.0, 0.0], [0.5, 0.5])",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "0.46450140402245893"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "d19cf924",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "distance.jensenshannon([1.0, 0.0, 0.0], [1.0, 0.0, 0.0])",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "0.0"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "cda5aaf7",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "a = np.array([[1, 2, 3, 4],\n              [5, 6, 7, 8],\n              [9, 10, 11, 12]])\nb = np.array([[13, 14, 15, 16],\n              [17, 18, 19, 20],\n              [21, 22, 23, 24]])\ndistance.jensenshannon(a, b, axis=0)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([0.1954288, 0.1447697, 0.1138377, 0.0927636])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "223474fc",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "distance.jensenshannon(a, b, axis=1)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([0.1402339, 0.0399106, 0.0201815])"
                    },
                    "execution_count": null
                }
            ]
        }
    ]
}