L1-python/source/Plotting I.ipynb

483 lines
115 KiB
Plaintext
Raw Permalink Normal View History

2023-01-20 11:25:32 +00:00
{
"cells": [
{
"cell_type": "markdown",
"id": "0a3e2a4e",
"metadata": {},
"source": [
"# Feuille 1 - UE Projet CMI-L1\n",
"Introduction to Python figures"
]
},
{
"cell_type": "markdown",
"id": "f8579363",
"metadata": {},
"source": [
"## **Libraries**"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "e4d24b04",
"metadata": {},
"outputs": [],
"source": [
"# libraries\n",
"import scipy \n",
"# \"SciPy\" provides algorithms for optimization, integration, interpolation, eigenvalue problems, \n",
"# algebraic equations, differential equations, statistics and many other classes of problems.\n",
"import numpy as np\n",
"# Fast and versatile, the \"NumPy\" vectorization, indexing, and broadcasting concepts are the \n",
"# de-facto standards of array computing today.\n",
"import matplotlib.pyplot as plt\n",
"# \"Matplotlib\" is a comprehensive library for creating static, animated, and interactive \n",
"# visualizations in Python."
]
},
{
"cell_type": "markdown",
"id": "6a8dcbb5",
"metadata": {},
"source": [
"## Anatomy of a figure"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "b5768c9e",
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline\n",
"from PIL import Image\n",
"img = Image.open('anatomy.webp')\n",
"img.save(\"anatomy.png\")"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "8f75cee3",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<img src=\"anatomy.png\" width=\"500\" height=\"500\"/>"
],
"text/plain": [
"<IPython.core.display.Image object>"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# import image module\n",
"from IPython.display import Image\n",
" \n",
"# get the image\n",
"Image(url=\"anatomy.png\", width=500, height=500)"
]
},
{
"cell_type": "markdown",
"id": "4c41a20d",
"metadata": {},
"source": [
"## Data"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "9e9a38b3",
"metadata": {},
"outputs": [],
"source": [
"# some data to work\n",
"x= np.linspace(0,2*np.pi)\n",
"y= np.sin(x)"
]
},
{
"cell_type": "markdown",
"id": "82c13c31",
"metadata": {},
"source": [
"## Figures : Implicit or explicit?\n",
"**Using figures**\n",
"- Explicitly create Figures and Axes, and call methods on them (the \"object-oriented (OO) style\").\n",
"- Rely on pyplot to implicitly create and manage the Figures and Axes, and use pyplot functions for plotting."
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "0f84f0db",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAZAAAAEWCAYAAABIVsEJAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAA2xElEQVR4nO3dd3yV9fn/8deVRSBAgBACIUAYIRCmEEHEwRYQRW1LpW5rKV9FFG0dVavVaq2tq2pVQETrxlGpAoI4EBQhDFlhhLDCDCsJISHr+v1xDv5iTELGObnPybmej8d5nHPu+b4duc7nHp+PqCrGGGNMdQU5HcAYY4x/sgJijDGmRqyAGGOMqRErIMYYY2rECogxxpgasQJijDGmRqyAGHMGInKViCz00rZni8hfvbDdnSIywtPbNaY0KyDGACJynoh8KyJZInJURJaJyNkAqvqmqo5yOmNZIqIikisiJ0Rkr4g8JSLB1dzGEBHJ8FZGU7+FOB3AGKeJSFPgE+D/gPeAMOB84JSTuaqoj6qmiUg34CtgK/CSs5FMoLAWiDHQFUBV31bVYlXNU9WFqroOQESuF5Glpxd2//K/WUS2iUiOiDwiIp1F5DsRyRaR90QkzL3sEBHJEJE/ichh96mlqyoKIiLjRGStiBx3t4h6V+UAVHUz8A3Qs5xtNhCRZ0Rkn/v1jHtaBDAfiHW3Yk6ISGx1/sGZwGYFxBjXr/ZiEXlNRMaISPMqrDMa6A+cA9wFTAeuAtrh+iM+sdSyrYGWQFvgOmC6iCSW3aCI9ANmAb8HooCXgbki0uBMYUQkCVeraU05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 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"# implicit \n",
"plt.plot(x,y,label=\"sin\")\n",
"plt.xlabel('x label')\n",
"plt.ylabel('y label')\n",
"plt.title(\"Simple Plot\")\n",
"plt.legend()\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "3f2d03de",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.legend.Legend at 0x7fa5029586d0>"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAACnCAYAAAAPOxtMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAjU0lEQVR4nO3deXxV1bn/8c+TmUwkkARIQphHQQKEEEAUq1Wpc2sFBRUtk4q9vd5qtXpvW69aa+/PWrUqAVRUQFBrRaU4VBFQwhAUkDkgQwiQABnIPD2/P87BIoaQeZ+TPO/XK6+cYZ+9n0NIvmettfdaoqoYY4wxZ+PjdAHGGGM8mwWFMcaYWllQGGOMqZUFhTHGmFpZUBhjjKmVBYUxxphaWVAYA4jIJBH5qJn2/YqIPNoM+90nIpc29X6NOZMFhWkzROQCEflSRPJF5ISIfCEiIwBUdYGqXuZ0jWcSERWRIhEpFJFDIvKUiPjWcx/jRCSzuWo0rZ+f0wUY0xJEJBx4H7gTWAIEAGOBMifrqqMhqpohIv2BFcAu4EVnSzJtibUoTFvRF0BVF6lqlaqWqOpHqroZQESmiMjqUxu7P8nfJSK7ReSkiPyviPQSkTUiUiAiS0QkwL3tOBHJFJHfisgxd5fQpLMVIiJXicjXIpLnbuGcX5c3oKo7gFXAoBr2GSgiT4tIlvvrafdjIcA/gVh3q6RQRGLr8w9njAWFaSt2AVUiMl9ExotIZB1ecwUwHEgB7gdSgU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PIiiofnOn2emxHiIju5C7FqSzO7uQX13ah3t+1MdaEU2gT6cw/n7XaH7z9haeXL6TrYc
"text/plain": [
"<Figure size 432x432 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"# explicity\n",
"fig = plt.figure(figsize=(6,6)) # size\n",
"ax = plt.subplot(aspect=1) # aspect ratio\n",
"ax.plot(x,y,label=\"sin\") # label\n",
"ax.set_xlabel('x') # Add an x-label to the axes.\n",
"ax.set_ylabel('y') # Add a y-label to the axes.\n",
"ax.set_title(\"Simple Plot\") # Add a title to the axes.\n",
"ax.legend() # Add a legend."
]
},
{
"cell_type": "markdown",
"id": "9d5ac225",
"metadata": {},
"source": [
"## Figure : lines"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "568d7656",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.legend.Legend at 0x7fa520ba0220>"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAACnCAYAAAAPOxtMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAp7ElEQVR4nO3dd5iU5dX48e9ZelMUUJAiqKAoKAKhWDEqSjRBE03AGhvqK2piL/G1RH/6ajRGTRQBawygGAVFUVERVFCK9CZSZFnpdZe6u+f3x5lxtszO7rI780w5n+uai5lnnpk5w+7OmbudW1QV55xzrixZQQfgnHMuuXmicM45F5MnCuecczF5onDOOReTJwrnnHMxeaJwzjkXkycK5wARuVhEPo7Tc78iIg/H4XlXiMgZ1f28zpXkicJlDBE5SUS+FpGtIrJJRL4SkV8AqOobqto36BhLEhEVkTwRyRWR1SLylIjUqORz9BGR7HjF6NJfzaADcC4RRGQ/4H3geuBNoDZwMrA7yLgq6DhVXSoiRwET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y4cV1Ovb9+ceGMDqps2fD7/7XZQH/elP8PXX9gfQsWOiQo0fERtnWby41F316llimDXLkkPYt9/a3/7rr/vffrXbssVaqLt2pUetlWOPtV+kW26Bjz4KOprkVda82VS+pMM6ikWLVDt3Lr6OoEkT1VGjynjAnj02b33WrMStsk60yZNVn3gi6l0FBaqPP65as2bx/7OBA22BsKuiggLVd96x37F0rK2ya5f9O2eO/S1lIHwdReq5/36YOzdy+/zzrRXx+9+X8YCbb4Z33oHjjku
"text/plain": [
"<Figure size 432x432 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"fig = plt.figure(figsize=(6,6))\n",
"ax = plt.subplot(aspect=1)\n",
"ax.plot(x,y,label=\"sin\",color='blue', linewidth=3, linestyle='--') \n",
"ax.plot(x,y*y,label=\"$\\sin^2$\",color='red', linewidth=1, linestyle='dotted') \n",
"ax.set_xlabel('x') # Add an x-label to the axes.\n",
"ax.set_ylabel('y') # Add a y-label to the axes.\n",
"ax.set_title(\"Simple Plot\") # Add a title to the axes.\n",
"ax.legend() # Add a legend."
]
},
{
"cell_type": "markdown",
"id": "287d0813",
"metadata": {},
"source": [
"## Figure and Axes"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "7cbcc514",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Text(0, 0.5, 'y')"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAACXCAYAAAALQRzhAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAZDUlEQVR4nO3df5AU5ZnA8e+z446rQKICF5WFLHdlLCtQKuxhjVbIkE1Q0DoQL5aJBJNchXiFR1JXJoSLmFMs8a4qlvlVGlSi3BE1JVGpE0VZnQrK5A4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5DwLzgKGJYh6w1l3+9JcicoqInKGq+2ocCwDFJ1ZT6FlPfvoV5OYsdp6zEpNx+fUU/Vp/xXboukYoHYFsi9DdDjn8v1PlWpHWU20elZSkvM5ftTKSHsXpOK39HcAaYFON1q2eAOwZ8riP43sLXvtMAGqeKIpPrKbr+a9SykD2+afoBnJzFluJyZTl1/or9BYo6WH6UUp6ePC74/edsl6qGSpMScrv/FUrLeV2UNUbcEo/9wJfBF4XkVtF5K+q/Gzx+rgK9nF2FFksIttFZPuBAwdCB1PoWU8pA/0tUGpxHsPRk0BGMnbwGk8Drb+Vs1YOa+H5fXf8nvd7H2MG+H13/M5ftTKiMQpVVRH5PfB74DBwKvCwiDytqt+s8LP7gIlDHrcDeyvYZyDG1cBqcC64CxtMfvoVZJ9/ipJC9ojzGKw2bEbGq/Xn993JTczRPe0Op0ww7QorL5kR8/tO+Z2/aqXsldkishS4BngTuAd4VFU/EJEW4HVVrahnISInAK8BXcAbwDbg86r60pB9LgWuw5n
"text/plain": [
"<Figure size 432x432 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"#\n",
"fig = plt.figure(figsize=(6,6))\n",
"ax = plt.subplot(aspect=1)\n",
"ax.plot(x,y,\".r\",label=\"$\\sin(x)$\") \n",
"ax.plot(x,y*y,\".g\",label=\"$\\sin(x)^2$\") \n",
"ax.legend()\n",
"ax.set_xlabel(\"x\")\n",
"ax.set_ylabel(\"y\")"
]
},
{
"cell_type": "markdown",
"id": "cf3594a3",
"metadata": {},
"source": [
"## Figures : axes and text"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "8cd16580",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Text(0, 0.5, 'y')"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAACnCAYAAAAPOxtMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlc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7UzkrK4uDBw9y8OBBsrKyqty5/N1333Huuef6HJ9xz8nB7LZAfqXnBUAvN+0uEpH1wE5ggqp+425nIjIaGA3Qvn37AIcaGDZoHT5skLtm55xzDvPnz+d3v/sdnTp14o477iAuLo6XXnqJa665pmIwe8yYMT7vc/jw4dx+++08/fTTvPPOO1XGKQYOHMiNN95Y8fyBBx5g8+bNxMTE0KFDh4ornnbt2lUxON2qVSsmTpzIhRdeCEBmZmbFwPaePXuIj4+nTZs2df67qO8cuzxWRK4BrlDVUa7nNwI9VfXuSm0SgVJVPSIiVwJPqWqnmvYdrpfHPvvpFqZnbaZUoYHAuIwujL2so9NhGVNNXl4egwcPJjc3N6Sf+5vf/Ia//vWvdOrk+b/5zJkzad++PUOHDvW6rxkzZpCYmMhtt90W6DCjkrfLY50sPRUA7So9T6Ks11BBVQ+p6hHX4yVArIi0Dl2IgWXljshQH66GysnJYciQIfTo0YPS0lKnw6nwl7/8hV27dnltc9ddd9WYJABatGjBzTffHKjQ6jUnexQNge+AfsAO4Cvg+sqlJRE5DdijqioiPYF3gA5aQ9Dh2qMAu7Eu3EVzeVBVycrKIjMzk9zcXAoLC2natCkLFy5k0KBBTodnHBaWN9ypaomI3AUsAxoA81T1GxEZ49o+GxgG3CEiJUAhMLymJBEOvCUDm/U1vEX
"text/plain": [
"<Figure size 432x432 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"# adding text\n",
"fig = plt.figure(figsize=(6,6))\n",
"ax = plt.subplot(aspect=1)\n",
"ax.plot(x,y,\".\",label=\"sin\") \n",
"ax.legend()\n",
"\n",
"\n",
"ax.text(0.3, 0.1, \"-> Mot\",family=\"cursive\",size=14)\n",
"ax.text(0.3, -0.5, \"-> Mot\",family=\"serif\",size = 14)\n",
"\n",
"ax.annotate('point (3,0)', xy=(3, 0), xytext=(4, 0.5),\n",
" arrowprops=dict(facecolor='black', shrink=0.05))\n",
"\n",
"ax.set_title('Title')\n",
"ax.set_xlabel(\"x\")\n",
"ax.set_ylabel(\"y\")\n",
"\n"
]
},
{
"cell_type": "markdown",
"id": "977fb62b",
"metadata": {},
"source": [
"## Figure : scales"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "5f4d1736",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.legend.Legend at 0x7fa501a7a220>"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEtCAYAAAAWZydGAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAkz0lEQVR4nO3dd3TV9f0/8Ofr3tybCQnJDWGEkLCnrBACbmspIujXzVBkBrRW229xVjus1q+2v1brQEPAKDKNWmUU6qhVgQQImzBkc4EASSAh4ya5ue/fHyFpSsM1uetz7+c+H+fkaG7ueBnv/Tzz3qKUAhER0ZUYtC6AiIj8G4OCiIicYlAQEZFTDAoiInKKQUFERE4xKIiIyCkGBZGXiMgeEbnByc+/FpGZvquIyDUhWhdAFKhEpLzJtxEAqgHUXfp+tlKqf5P7/hZAD6XU/b6rkMgzGBRELlJKRTX8u4gcBTBTKfWFdhUReQe7noi8RESOisjNIjIGwDMA7hORchHZcYX7TxeRvSJyXkTWiUhX31ZM1DwGBZGXKaXWAvgDgOVKqSil1KDL7yMi/4P6MLkTQDyAbwEs9WWdRFfCoCDyD7MBvKSU2quUsqM+WAazVUH+gEFB5B+6AnhNRC6IyAUAJQAEQGdNqyICB7OJfOWHtmk+AeBFpdRiXxRD1BpsURD5xhkAySJypc/c2wCeFpH+ACAi0SJyj8+qI3KCQUHkGx9e+mexiGy9/IdKqU8AvAxgmYiUAdgN4BYf1kd0RcKDi4iIyBm2KIiIyCkGBREROcWgICIipxgURETkFIOCiIic0uWCO4vFopKTk7Uug4goYOT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 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"fig = plt.figure(figsize=(6,6)) # size\n",
"ax = plt.subplot(aspect=1) # aspect ratio\n",
"\n",
"ax.plot(x,y,label=\"sin\") # label\n",
"ax.set_xscale('log')\n",
"ax.set_yscale('log')\n",
"ax.set_xlabel('x') # Add an x-label to the axes.\n",
"ax.set_ylabel('y') # Add a y-label to the axes.\n",
"ax.set_title(\"Title\") # Add a title to the axes.\n",
"ax.legend() # Add a legend."
]
},
{
"cell_type": "markdown",
"id": "b2266d48",
"metadata": {},
"source": [
"## Figure : multiples"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "45b0275c",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x7fa502cd0610>]"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAa8AAAG0CAYAAACFeqhZAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAABUTElEQVR4nO29eXRk93Xf+b21r1iqUOhGo9Hshd2UKNKk6BZFRwspS9RQGluUPM6Emoks+1jmKDY9sT0nE8aeo0nmOImcsWOPx4oZ2pYlT2zJdixatEWKWmKtlmQ29ybZG5sAG0ADqAVAbaj9N3+89wpFNLaqesvv9979nIPTQL1Xr34ELu+9v7v9SAgBhmEYhlEJn9MLYBiGYZh+YePFMAzDKAcbL4ZhGEY52HgxDMMwysHGi2EYhlEONl4MwzCMcrDxYhiGURQiOkJEZSLy73KPIKLr7VyXHbDxYhiGUQgimiWi9wCAEOI1IURCCNHWr32DiD7m7ArtgY0XwzAMoxxsvGyGiB4koleIqERELxHRh5xeE8MwakBE/x+AIwD+Rg8X/u96WDBARP8WwDsA/J5+7fe2eX+YiH6TiF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g4nK5Ly8a0DzpI+kYXsmWLVoZIyvnl4qIh/yYHov29b4TmThWq00UKg2LVsbIyKu5Clod0bfxOp7RJre8kuWd10542njN5Suotzo41adgAdoRKSxY3uP8cgmnDib7PizwxKSWrGeHx1ucWyoC6H+nHg8HMDUawSsrLC874WnjZWzJ+41HA5rxmstX0Grz8SheQQgxUP4CAK7PaMbrMhsvT3FhuYSAj3B8Yn+Vhr1
"text/plain": [
"<Figure size 432x432 with 3 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"fig, (ax0, ax1, ax2) = plt.subplots(nrows=1, ncols=3,\n",
" figsize=(6, 6))\n",
"fig.tight_layout()\n",
"ax0.set_title('a')\n",
"ax0.plot(x,y,label=\"sin\") # label\n",
"\n",
"ax1.plot(x,y,label=\"sin\") # label\n",
"\n",
"ax2.set_title('title')\n",
"ax2.plot(x,y,label=\"sin\") # label\n"
]
},
{
"cell_type": "markdown",
"id": "fecf66d0",
"metadata": {},
"source": [
"## Figure : save"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "2c22bda9",
"metadata": {},
"outputs": [],
"source": [
"fig.savefig(\"output.pdf\")\n",
"fig.savefig(\"output.png\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.9.7"
}
},
"nbformat": 4,
"nbformat_minor": 5
}