{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", " 線形代数(Linear algebra) scipy版 \n", "
\n", "
\n", " cc by Shigeto R. Nishitani, 2017-2018 \n", "
\n", "* file: /Users/bob/python/doing_math_with_python/linear_algebra_scipy.ipynb\n", "\n", "pythonでの線形代数のlibraryはいくつもあるように見える.\n", "混乱しがちなんで,それをいくつか分類してみた.\n", "間違ってたら教えて.\n", "\n", "* numpy.linalg\n", "* scipy.linalg\n", "* sympy\n", "\n", "scipyはnumpyのwrapperっぽい.[NumpyとScipy](https://www.eidos.ic.i.u-tokyo.ac.jp/~tau/lecture/computational_physics/slide/numpy.pdf)によると,\n", "1. NumPy ⊂ SciPy ということのようだ\n", "1. numpy で提供されている機能はそのまま, scipy でも提供されている\n", "1. なので scipy だけで押し通しても良さそうだが, 世の中の説明は numpy が主流なので, それに合わせて, 基本は numpy, scipy だけで 提供されている機能は scipy を使う\n", "\n", "と明言されている.これが一番混乱がなさそう.\n", "\n", "sympyは代数計算向きなんで,表記がだいぶ違う.[別章](./linear_algebra_sympy.ipynb)として提供.\n", "\n", "\n" ] }, { "cell_type": "markdown", "metadata": { "toc": "true" }, "source": [ "# Table of Contents\n", "

1  出力精度の制御
2  行列,ベクトルの生成
2.1  ゼロ行列,単位行列
2.2  転置(transpose)
3  行列,ベクトルの演算
3.1  ドット積
3.2  外積,outer, cross
3.3  スカラー三重積
4  行列要素のとりだし,追加
5  掃き出し, LU分解
5.1  階数
6  逆行列
6.1  行列式
6.2  連立方程式の解
6.3  課題
7  固有値,固有ベクトル
7.1  ベクトルの規格化
7.2  対角化
7.3  課題
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 出力精度の制御\n", "\n", "行列の出力はとても醜くなる場合がある.\n", "ほぼ0なのにとか,次元が増えてとかで.そのときこいつが役立つ." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "array([ 6., -3.])\n", "array([[ 0.78086881, -0.70710678],\n", " [ 0.62469505, 0.70710678]])\n", "array([ 6., -3.])\n", "array([[ 0.781, -0.707],\n", " [ 0.625, 0.707]])\n" ] } ], "source": [ "import numpy as np\n", "from pprint import pprint\n", "import scipy.linalg as linalg\n", "\n", "a = np.array([[2,5], [4,1]])\n", "l,P = np.linalg.eig(a)\n", "pprint(l)\n", "pprint(P)\n", "\n", "np.set_printoptions(precision=3, suppress=True)\n", "\n", "pprint(l)\n", "pprint(P)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 行列,ベクトルの生成" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[[1 2]\n", " [3 4]]\n", "[[1 2]\n", " [3 4]]\n", "[[1 2]\n", " [3 4]]\n" ] } ], "source": [ "import numpy as np\n", "import scipy as sp\n", "list_a = [1,2]\n", "list_b = [3,4]\n", "np_a = np.array([list_a, list_b])\n", "print(np_a)\n", "\n", "sp_a = sp.array([list_a, list_b])\n", "print(sp_a)\n", "\n", "np_m = np.matrix([list_a, list_b])\n", "print(np_m)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[1 2]\n", "[[1 2]]\n" ] } ], "source": [ "list_a = [1,2]\n", "\n", "np_a_1 = np.array(list_a)\n", "print(np_a_1)\n", "\n", "np_v = np.array([list_a])\n", "print(np_v)\n", "# np.vectorはない." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## ゼロ行列,単位行列" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[0., 0., 0.],\n", " [0., 0., 0.],\n", " [0., 0., 0.]])" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np.zeros((3,3))" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[1, 0, 0],\n", " [0, 2, 0],\n", " [0, 0, 3]])" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np.diag([1,2,3])" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[1., 0., 0.],\n", " [0., 1., 0.],\n", " [0., 0., 1.]])" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np.identity(3)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 転置(transpose)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[[1 3]\n", " [2 4]]\n", "[[1 3]\n", " [2 4]]\n", "[[1 3]\n", " [2 4]]\n" ] } ], "source": [ "print(np_a.transpose())\n", "print(sp_a.transpose())\n", "print(np_m.transpose())" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[1],\n", " [2]])" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np_v.transpose()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 行列,ベクトルの演算\n", "## ドット積" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$$\n", "\\left[\n", "\\begin {array}{cc} \n", "1&2\\\\\n", "3&4\n", "\\end {array} \\right]\n", "\\left[\n", "\\begin {array}{c} \n", "1\\\\\n", "2\n", "\\end {array} \\right]\n", "$$\n", "\n", "を計算したいときは," ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[ 5],\n", " [11]])" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np.dot(np_a,np.transpose(np_v))" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[ 7, 10]])" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np_v.dot(np_a)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "これだと,\n", "$$\n", "\\left[\n", "\\begin {array}{cc} \n", "1&2\n", "\\end {array} \\right]\n", "\\left[\n", "\\begin {array}{cc} \n", "1&2\\\\\n", "3&4\n", "\\end {array} \\right]\n", "$$\n", "\n", "を計算することになる." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "ベクトルの距離\n", "$$\n", "\\left[\n", "\\begin {array}{cc} \n", "1&2\n", "\\end {array} \\right]\n", "\\left[\n", "\\begin {array}{cc} \n", "1\\\\\n", "2\n", "\\end {array} \\right]\n", "$$\n", "は" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "scrolled": true }, "outputs": [ { "ename": "ValueError", "evalue": "shapes (1,2) and (1,2) not aligned: 2 (dim 1) != 1 (dim 0)", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mnp_v\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnp_v\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[0;31mValueError\u001b[0m: shapes (1,2) and (1,2) not aligned: 2 (dim 1) != 1 (dim 0)" ] } ], "source": [ "np_v.dot(np_v)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "ではダメで," ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[5]])" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np_v.dot(np_v.transpose())" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[1, 2],\n", " [2, 4]])" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np_v.transpose().dot(np_v)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "と順番を間違うと悲惨.単に長さをだけなら$||v||$の代わりにnp.linalg.norm(v)も使える." ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5.0000000000000009" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np.linalg.norm(np_v,2)**2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "ただし,normなんでそのほかの指数も指定できる." ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "4.0" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np.linalg.norm(np_v,1)**2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 外積,outer, cross" ] }, { "cell_type": "code", "execution_count": 30, "metadata": { "collapsed": true }, "outputs": [], "source": [ "v1 = np.array([1,1,3])\n", "v2 = np.array([1,2,-1])" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[ 1, 2, -1],\n", " [ 1, 2, -1],\n", " [ 3, 6, -3]])" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np.outer(v1,v2)" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([-7, 4, 1])" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np.cross(v1,v2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## スカラー三重積" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "16" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "v3 = np.array([-1,2,1])\n", "np.dot(np.cross(v1,v2),v3)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 行列要素のとりだし,追加" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a=np.array([[1,2,3],[4,5,6],[7,8,9]])\n", "# i行j列の要素の取り出し\n", "a[1,1]" ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[2, 3],\n", " [5, 6]])" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a[:2,1:4]" ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[1 4 7]\n" ] } ], "source": [ "col_0 = a[:,0]\n", "print(col_0)" ] }, { "cell_type": "code", "execution_count": 36, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[4 5 6]\n" ] } ], "source": [ "row_1 = a[1,:]\n", "print(row_1)" ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[1, 2, 3],\n", " [4, 5, 6],\n", " [7, 8, 9],\n", " [1, 2, 3]])" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "b = np.array([1,2,3])\n", "np.vstack((a,b))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "hstackはa,bが同じ次元でないとダメとのお達し.拡大係数行列を手軽に作れるわけではなさそう.column_stackを使うとできた." ] }, { "cell_type": "code", "execution_count": 38, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[1, 2, 3, 1],\n", " [4, 5, 6, 2],\n", " [7, 8, 9, 3]])" ] }, "execution_count": 38, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np.column_stack((a,b))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 掃き出し, LU分解" ] }, { "cell_type": "code", "execution_count": 43, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[[1. 0. 0.]\n", " [0. 0. 1.]\n", " [0. 1. 0.]]\n", "[[1. 0. 0.]\n", " [1. 1. 0.]\n", " [1. 0. 1.]]\n", "[[ 1. -1. -1.]\n", " [ 0. 2. 0.]\n", " [ 0. 0. 2.]]\n" ] } ], "source": [ "import scipy.linalg\n", "\n", "a = np.array([[1,-1,-1],[1,-1,1],[1,1,-1]])\n", "\n", "P, L, U = scipy.linalg.lu(a)\n", "\n", "print(P)\n", "print(L)\n", "print(U)" ] }, { "cell_type": "code", "execution_count": 45, "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[[1. 0. 0.]\n", " [0. 0. 1.]\n", " [0. 1. 0.]]\n", "[[1. 0. 0.]\n", " [1. 1. 0.]\n", " [1. 0. 1.]]\n", "[[ 1. -1. -1. 1.]\n", " [ 0. 2. 0. -2.]\n", " [ 0. 0. 2. -2.]]\n" ] } ], "source": [ "b = np.array([1,-1,-1])\n", "ab = np.column_stack((a,b))\n", "P, L, U = scipy.linalg.lu(ab)\n", "print(P)\n", "print(L)\n", "print(U)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 階数" ] }, { "cell_type": "code", "execution_count": 42, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[[1 2 3]\n", " [4 5 6]\n", " [7 8 9]]\n", "2\n", "2\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/Users/syasin/anaconda3/lib/python3.6/site-packages/ipykernel_launcher.py:4: VisibleDeprecationWarning: `rank` is deprecated; use the `ndim` attribute or function instead. To find the rank of a matrix see `numpy.linalg.matrix_rank`.\n", " after removing the cwd from sys.path.\n" ] } ], "source": [ "print(a)\n", "\n", "print(np.linalg.matrix_rank(a))\n", "print(np.rank(a)) #deprecatedなんでやめろって,\n", "# 関数名とかlibの区分けに統一性がないよね...\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 逆行列" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[-2. , 1. ],\n", " [ 1.5, -0.5]])" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a = np.array([[1,2],[3,4]])\n", "scipy.linalg.inv(a)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 行列式" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1.0\n" ] }, { "data": { "text/plain": [ "-2.0" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "c = np.array([[1,1],[1,2]])\n", "print(np.linalg.det(c))\n", "\n", "a = np.array([[1,2],[3,4]])\n", "scipy.linalg.det(a)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 連立方程式の解\n", "逆行列を用いて,連立方程式の解を求めるには次の通り.\n", "例えば,連立方程式が次のような場合,\n", "$$\n", "x - y -z = 1 \\\\\n", "x - y +z = -1 \\\\\n", "x + y -z = -1\n", "$$" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([-1., -1., -1.])" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a=np.array([[1,-1,-1],[1,-1,1],[1,1,-1]])\n", "b = np.array([1,-1,-1])\n", "scipy.linalg.inv(a).dot(b)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 課題\n", "次の連立方程式を解け.\n", "$$ \n", "\\left\\{\n", "\\begin {array}{cl} \n", "x+y+z&=0\\\\\n", "ax+by+cz&=0\\\\\n", "bcx+cay+abz&=(a-b)(b-c)(c-a)\n", "\\end {array} \\right.\n", "$$\n" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Matrix([[1, 1, 1], [a, b, c], [b*c, a*c, a*b]])\n", "Matrix([[0], [0], [(-a + c)*(a - b)*(b - c)]])\n", "-b + c\n", "a - c\n", "-a + b\n" ] } ], "source": [ "from pprint import pprint\n", "from sympy import *\n", "a,b,c,x,y,z = symbols('a b c x y z')\n", "\n", "A = Matrix([[1,1,1],[a,b,c],[b*c,c*a,a*b]])\n", "bb = Matrix([0,0,(a-b)*(b-c)*(c-a)])\n", "print(A)\n", "print(bb)\n", "Ainv = A.inv()\n", "res = Ainv * bb\n", "pprint(simplify(res[0]))\n", "pprint(simplify(res[1]))\n", "pprint(simplify(res[2]))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# 固有値,固有ベクトル" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[ 1.+0.j 2.+0.j]\n", "[[ 1. 0.70710678]\n", " [ 0. 0.70710678]]\n" ] } ], "source": [ "a = np.array([[1,1],[0,2]])\n", "l, P = scipy.linalg.eig(a)\n", "print(l)\n", "print(P)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## ベクトルの規格化" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0.99999999999999989" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# eigの固有ベクトルは規格化されている\n", "p_norm = np.linalg.norm(P[:,1])\n", "p_norm\n", "# 規格化はこいつをつかって..." ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## 対角化\n", "\n", "Pに固有ベクトルが入っているので,対角化は$P^{-1} A P$で" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[ 1., 0.],\n", " [ 0., 2.]])" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "np.dot(np.dot(np.linalg.inv(P),a),P)\n", "#np.dot(np.dot(np.linalg.inv(P),a),P)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 課題\n", "行列\n", "$$\n", "A\\, = \\, \\left[\n", "\\begin {array}{ccc} \n", "2&0&1\\\\\n", "0&3&0\\\\\n", "1&0&2\n", "\\end {array} \\right]\n", "$$\n", "\n", "を対角化する変換行列$P$を求め,対角化せよ." ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[ 3. 1. 3.]\n", "[[ 0.70710678 -0.70710678 0. ]\n", " [ 0. 0. 1. ]\n", " [ 0.70710678 0.70710678 0. ]]\n" ] }, { "data": { "text/plain": [ "array([[ 3.00000000e+00, 4.80650139e-17, 0.00000000e+00],\n", " [ -1.01465364e-17, 1.00000000e+00, 0.00000000e+00],\n", " [ 0.00000000e+00, 0.00000000e+00, 3.00000000e+00]])" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import numpy as np\n", "\n", "A = np.array([[2,0,1],[0,3,0],[1,0,2]])\n", "l, P = np.linalg.eig(A)\n", "print(l)\n", "print(P)\n", "\n", "np.dot(np.dot(np.linalg.inv(P),A),P)" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([ 0. , 0.78539816, 1.57079633, 2.35619449, 3.14159265,\n", " 3.92699082, 4.71238898, 5.49778714, 6.28318531])" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import numpy as np\n", "from math import pi\n", "\n", "np.linspace(0,2*pi,9)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.1" }, "latex_envs": { "LaTeX_envs_menu_present": true, "autocomplete": true, "bibliofile": "biblio.bib", "cite_by": "apalike", "current_citInitial": 1, "eqLabelWithNumbers": true, "eqNumInitial": 1, "hotkeys": { "equation": "Ctrl-E", "itemize": "Ctrl-I" }, "labels_anchors": false, "latex_user_defs": false, "report_style_numbering": false, "user_envs_cfg": false }, "toc": { "colors": { "hover_highlight": "#DAA520", "navigate_num": "#000000", "navigate_text": "#333333", "running_highlight": "#FF0000", "selected_highlight": "#FFD700", "sidebar_border": "#EEEEEE", "wrapper_background": "#FFFFFF" }, "moveMenuLeft": true, "nav_menu": { "height": "84px", "width": "252px" }, "navigate_menu": true, "number_sections": true, "sideBar": true, "threshold": 4, "toc_cell": true, "toc_section_display": "block", "toc_window_display": true, "widenNotebook": false } }, "nbformat": 4, "nbformat_minor": 2 }