{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "fbb71dba",
            "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": "4a1a40a7",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "import numpy as np\nfrom scipy.linalg import norm\na = np.arange(9) - 4.0\na",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([-4., -3., -2., -1.,  0.,  1.,  2.,  3.,  4.])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "57eb75a3",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "b = a.reshape((3, 3))\nb",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([[-4., -3., -2.],\n       [-1.,  0.,  1.],\n       [ 2.,  3.,  4.]])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "31b2ce81",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "norm(a)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "7.745966692414834"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "84e378d9",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "norm(b)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "7.745966692414834"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "0d95e4e6",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "norm(b, 'fro')",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "7.745966692414834"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "22ae6361",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "norm(a, np.inf)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "4.0"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "4486c908",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "norm(b, np.inf)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "9.0"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "d7eef594",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "norm(a, -np.inf)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "0.0"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "150b1350",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "norm(b, -np.inf)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "2.0"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "202cce9d",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "norm(a, 1)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "20.0"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "650c4be3",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "norm(b, 1)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "7.0"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "45a12317",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "norm(a, -1)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "-4.6566128774142013e-010"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "c1036600",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "norm(b, -1)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "6.0"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "a62c7915",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "norm(a, 2)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "7.745966692414834"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "fa60482f",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "norm(b, 2)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "7.3484692283495345"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "9cfb0ecb",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "norm(a, -2)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "0.0"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "5a5cd501",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "norm(b, -2)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "1.8570331885190563e-016"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "b59b28b6",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "norm(a, 3)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "5.8480354764257312"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "388b8c11",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "norm(a, -3)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "0.0"
                    },
                    "execution_count": null
                }
            ]
        }
    ]
}