{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "b376816a",
            "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": "879ee782",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "import numpy as np\nX = np.array([[1, 2, 3], [0, 4, 5], [0, -5, 4]])\nX",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([[ 1,  2,  3],\n       [ 0,  4,  5],\n       [ 0, -5,  4]])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "b3ae5d1b",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "from scipy import linalg\nw, v = linalg.eig(X)\nw",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([ 1.+0.j,  4.+5.j,  4.-5.j])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "d9e1c4b4",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "v",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([[ 1.00000+0.j     , -0.01906-0.40016j, -0.01906+0.40016j],\n       [ 0.00000+0.j     ,  0.00000-0.64788j,  0.00000+0.64788j],\n       [ 0.00000+0.j     ,  0.64788+0.j     ,  0.64788-0.j     ]])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "8e80b80d",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "wr, vr = linalg.cdf2rdf(w, v)\nwr",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([[ 1.,  0.,  0.],\n       [ 0.,  4.,  5.],\n       [ 0., -5.,  4.]])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "7e205233",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "vr",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([[ 1.     ,  0.40016, -0.01906],\n       [ 0.     ,  0.64788,  0.     ],\n       [ 0.     ,  0.     ,  0.64788]])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "027a3947",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "vr @ wr",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([[ 1.     ,  1.69593,  1.9246 ],\n       [ 0.     ,  2.59153,  3.23942],\n       [ 0.     , -3.23942,  2.59153]])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "6689c495",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "X @ vr",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([[ 1.     ,  1.69593,  1.9246 ],\n       [ 0.     ,  2.59153,  3.23942],\n       [ 0.     , -3.23942,  2.59153]])"
                    },
                    "execution_count": null
                }
            ]
        }
    ]
}