Run notebooks with updates and custom kernel

This commit is contained in:
Alexander Hess 2024-07-15 10:33:13 +02:00
parent 79a2e45e49
commit 3125c82096
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
13 changed files with 102 additions and 114 deletions

View file

@ -536,9 +536,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "intro-to-data-science",
"language": "python",
"name": "python3"
"name": "intro-to-data-science"
},
"language_info": {
"codemirror_mode": {
@ -550,7 +550,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.12.4"
},
"toc": {
"base_numbering": 1,

View file

@ -149,9 +149,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "intro-to-data-science",
"language": "python",
"name": "python3"
"name": "intro-to-data-science"
},
"language_info": {
"codemirror_mode": {
@ -163,7 +163,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.12.4"
},
"toc": {
"base_numbering": 1,

View file

@ -507,7 +507,7 @@
"\n",
"The indented line constitues the `for`-loop's body. In the example, we simply take each of the numbers in `numbers`, one at a time, and add it to a `total` that is initialized at `0`. In other words, we calculate the sum of all the elements in `numbers`.\n",
"\n",
"Many beginners struggle with the term \"loop.\" To visualize the looping behavior of this code, we use the online tool [PythonTutor <img height=\"12\" style=\"display: inline-block\" src=\"../static/link/to_py.png\">](http://pythontutor.com/visualize.html#code=numbers%20%3D%20%5B1,%202,%203,%204%5D%0A%0Atotal%20%3D%200%0A%0Afor%20number%20in%20numbers%3A%0A%20%20%20%20total%20%3D%20total%20%2B%20number%0A%0Atotal&cumulative=false&curInstr=0&heapPrimitives=nevernest&mode=display&origin=opt-frontend.js&py=3&rawInputLstJSON=%5B%5D&textReferences=false). That tool is helpful for two reasons:\n",
"Many beginners struggle with the term \"loop.\" To visualize the looping behavior of this code, we use the online tool [PythonTutor <img height=\"12\" style=\"display: inline-block\" src=\"../static/link/to_py.png\">](http://pythontutor.com/visualize.html#code=numbers%20%3D%20%5B1,%202,%203,%204%5D%0A%0Atotal%20%3D%200%0A%0Afor%20number%20in%20numbers%3A%0A%20%20%20%20total%20%3D%20total%20%2B%20number%0A%0Atotal&cumulative=false&curstr=0&heapPrimitives=nevernest&mode=display&origin=opt-frontend.js&py=3&rawInputLstJSON=%5B%5D&textReferences=false). That tool is helpful for two reasons:\n",
"1. It allows us to execute code in \"slow motion\" (i.e., by clicking the \"next\" button on the left side, only the next atomic step of the code snippet is executed).\n",
"2. It shows what happens inside the computer's memory on the right-hand side."
]
@ -999,9 +999,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "intro-to-data-science",
"language": "python",
"name": "python3"
"name": "intro-to-data-science"
},
"language_info": {
"codemirror_mode": {
@ -1013,7 +1013,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.12.4"
},
"toc": {
"base_numbering": 1,

View file

@ -178,9 +178,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "intro-to-data-science",
"language": "python",
"name": "python3"
"name": "intro-to-data-science"
},
"language_info": {
"codemirror_mode": {
@ -192,7 +192,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.12.4"
},
"toc": {
"base_numbering": 1,

View file

@ -112,9 +112,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "intro-to-data-science",
"language": "python",
"name": "python3"
"name": "intro-to-data-science"
},
"language_info": {
"codemirror_mode": {
@ -126,7 +126,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.12.4"
},
"toc": {
"base_numbering": 1,

View file

@ -73,7 +73,7 @@
"\n",
"Let's execute the function with `numbers` as the input. We see the same `6` below the cell as we do above where we run the code without a function. Without the `return` statement in the function's body, we would not see any output here.\n",
"\n",
"To see what happens in detail, take a look at [PythonTutor <img height=\"12\" style=\"display: inline-block\" src=\"../static/link/to_py.png\">](https://pythontutor.com/visualize.html#code=numbers%20%3D%20%5B1,%202,%203,%204%5D%0A%0Adef%20add_evens%28numbers%29%3A%0A%20%20%20%20%22%22%22Sum%20up%20all%20the%20even%20numbers%20in%20a%20list.%22%22%22%0A%20%20%20%20result%20%3D%200%0A%0A%20%20%20%20for%20number%20in%20numbers%3A%0A%20%20%20%20%20%20%20%20if%20number%20%25%202%20%3D%3D%200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20result%20%3D%20result%20%2B%20number%0A%0A%20%20%20%20return%20result%0A%0Atotal%20%3D%20add_evens%28numbers%29&cumulative=false&curInstr=0&heapPrimitives=nevernest&mode=display&origin=opt-frontend.js&py=3&rawInputLstJSON=%5B%5D&textReferences=false) again. You should notice how there are two variables by the name `numbers` in memory. Python manages the memory with a concept called **namespaces** or **scopes**, which are just fancy terms for saying that Python can tell variables from different contexts apart."
"To see what happens in detail, take a look at [PythonTutor <img height=\"12\" style=\"display: inline-block\" src=\"../static/link/to_py.png\">](https://pythontutor.com/visualize.html#code=numbers%20%3D%20%5B1,%202,%203,%204%5D%0A%0Adef%20add_evens%28numbers%29%3A%0A%20%20%20%20%22%22%22Sum%20up%20all%20the%20even%20numbers%20in%20a%20list.%22%22%22%0A%20%20%20%20result%20%3D%200%0A%0A%20%20%20%20for%20number%20in%20numbers%3A%0A%20%20%20%20%20%20%20%20if%20number%20%25%202%20%3D%3D%200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20result%20%3D%20result%20%2B%20number%0A%0A%20%20%20%20return%20result%0A%0Atotal%20%3D%20add_evens%28numbers%29&cumulative=false&curstr=0&heapPrimitives=nevernest&mode=display&origin=opt-frontend.js&py=3&rawInputLstJSON=%5B%5D&textReferences=false) again. You should notice how there are two variables by the name `numbers` in memory. Python manages the memory with a concept called **namespaces** or **scopes**, which are just fancy terms for saying that Python can tell variables from different contexts apart."
]
},
{
@ -151,7 +151,7 @@
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m/tmp/user/1000/ipykernel_707190/1049141082.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mresult\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"Cell \u001b[0;32mIn[5], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mresult\u001b[49m\n",
"\u001b[0;31mNameError\u001b[0m: name 'result' is not defined"
]
}
@ -505,9 +505,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "intro-to-data-science",
"language": "python",
"name": "python3"
"name": "intro-to-data-science"
},
"language_info": {
"codemirror_mode": {
@ -519,7 +519,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.12.4"
},
"toc": {
"base_numbering": 1,

View file

@ -257,9 +257,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "intro-to-data-science",
"language": "python",
"name": "python3"
"name": "intro-to-data-science"
},
"language_info": {
"codemirror_mode": {
@ -271,7 +271,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.12.4"
},
"toc": {
"base_numbering": 1,

View file

@ -237,19 +237,18 @@
"metadata": {},
"outputs": [
{
"ename": "AttributeError",
"evalue": "'int' object has no attribute 'is_integer'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m/tmp/user/1000/ipykernel_306555/2418692311.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0ma\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_integer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m: 'int' object has no attribute 'is_integer'"
"data": {
"text/plain": [
"True"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a.is_integer()"
"a.is_integer() # Note: In Python versions < 3.12 this cell raises an `AttributeError`"
]
},
{
@ -494,7 +493,7 @@
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m/tmp/user/1000/ipykernel_306555/2667408552.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mmore_numbers\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m10\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"Cell \u001b[0;32mIn[21], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mmore_numbers\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mappend\u001b[49m(\u001b[38;5;241m10\u001b[39m)\n",
"\u001b[0;31mAttributeError\u001b[0m: 'tuple' object has no attribute 'append'"
]
}
@ -607,7 +606,7 @@
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mKeyError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m/tmp/user/1000/ipykernel_306555/3320204082.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mto_words\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"zero\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"Cell \u001b[0;32mIn[26], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mto_words\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mzero\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\n",
"\u001b[0;31mKeyError\u001b[0m: 'zero'"
]
}
@ -673,9 +672,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "intro-to-data-science",
"language": "python",
"name": "python3"
"name": "intro-to-data-science"
},
"language_info": {
"codemirror_mode": {
@ -687,7 +686,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.12.4"
},
"toc": {
"base_numbering": 1,

View file

@ -50,8 +50,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: numpy in /home/webartifex/repos/intro-to-data-science/.venv/lib/python3.8/site-packages (1.21.1)\n",
"Note: you may need to restart the kernel to use updated packages.\n"
"Requirement already satisfied: numpy in /home/instructor/Repositories/intro-to-data-science/.venv/lib/python3.12/site-packages (2.0.0)\n"
]
}
],
@ -68,15 +67,17 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: matplotlib in /home/webartifex/repos/intro-to-data-science/.venv/lib/python3.8/site-packages (3.4.3)\n",
"Requirement already satisfied: python-dateutil>=2.7 in /home/webartifex/repos/intro-to-data-science/.venv/lib/python3.8/site-packages (from matplotlib) (2.8.2)\n",
"Requirement already satisfied: cycler>=0.10 in /home/webartifex/repos/intro-to-data-science/.venv/lib/python3.8/site-packages (from matplotlib) (0.10.0)\n",
"Requirement already satisfied: pyparsing>=2.2.1 in /home/webartifex/repos/intro-to-data-science/.venv/lib/python3.8/site-packages (from matplotlib) (2.4.7)\n",
"Requirement already satisfied: kiwisolver>=1.0.1 in /home/webartifex/repos/intro-to-data-science/.venv/lib/python3.8/site-packages (from matplotlib) (1.3.2)\n",
"Requirement already satisfied: pillow>=6.2.0 in /home/webartifex/repos/intro-to-data-science/.venv/lib/python3.8/site-packages (from matplotlib) (8.3.2)\n",
"Requirement already satisfied: numpy>=1.16 in /home/webartifex/repos/intro-to-data-science/.venv/lib/python3.8/site-packages (from matplotlib) (1.21.1)\n",
"Requirement already satisfied: six in /home/webartifex/repos/intro-to-data-science/.venv/lib/python3.8/site-packages (from cycler>=0.10->matplotlib) (1.16.0)\n",
"Note: you may need to restart the kernel to use updated packages.\n"
"Requirement already satisfied: matplotlib in /home/instructor/Repositories/intro-to-data-science/.venv/lib/python3.12/site-packages (3.9.1)\n",
"Requirement already satisfied: contourpy>=1.0.1 in /home/instructor/Repositories/intro-to-data-science/.venv/lib/python3.12/site-packages (from matplotlib) (1.2.1)\n",
"Requirement already satisfied: cycler>=0.10 in /home/instructor/Repositories/intro-to-data-science/.venv/lib/python3.12/site-packages (from matplotlib) (0.12.1)\n",
"Requirement already satisfied: fonttools>=4.22.0 in /home/instructor/Repositories/intro-to-data-science/.venv/lib/python3.12/site-packages (from matplotlib) (4.53.1)\n",
"Requirement already satisfied: kiwisolver>=1.3.1 in /home/instructor/Repositories/intro-to-data-science/.venv/lib/python3.12/site-packages (from matplotlib) (1.4.5)\n",
"Requirement already satisfied: numpy>=1.23 in /home/instructor/Repositories/intro-to-data-science/.venv/lib/python3.12/site-packages (from matplotlib) (2.0.0)\n",
"Requirement already satisfied: packaging>=20.0 in /home/instructor/Repositories/intro-to-data-science/.venv/lib/python3.12/site-packages (from matplotlib) (24.1)\n",
"Requirement already satisfied: pillow>=8 in /home/instructor/Repositories/intro-to-data-science/.venv/lib/python3.12/site-packages (from matplotlib) (10.4.0)\n",
"Requirement already satisfied: pyparsing>=2.3.1 in /home/instructor/Repositories/intro-to-data-science/.venv/lib/python3.12/site-packages (from matplotlib) (3.1.2)\n",
"Requirement already satisfied: python-dateutil>=2.7 in /home/instructor/Repositories/intro-to-data-science/.venv/lib/python3.12/site-packages (from matplotlib) (2.9.0.post0)\n",
"Requirement already satisfied: six>=1.5 in /home/instructor/Repositories/intro-to-data-science/.venv/lib/python3.12/site-packages (from python-dateutil>=2.7->matplotlib) (1.16.0)\n"
]
}
],
@ -368,8 +369,7 @@
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m/tmp/user/1000/ipykernel_1264563/568665770.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mv1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mm1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m<__array_function__ internals>\u001b[0m in \u001b[0;36mdot\u001b[0;34m(*args, **kwargs)\u001b[0m\n",
"Cell \u001b[0;32mIn[12], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdot\u001b[49m\u001b[43m(\u001b[49m\u001b[43mv1\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mm1\u001b[49m\u001b[43m)\u001b[49m\n",
"\u001b[0;31mValueError\u001b[0m: shapes (5,) and (2,5) not aligned: 5 (dim 0) != 2 (dim 0)"
]
}
@ -429,7 +429,7 @@
{
"data": {
"text/plain": [
"1"
"np.int64(1)"
]
},
"execution_count": 14,
@ -449,7 +449,7 @@
{
"data": {
"text/plain": [
"5"
"np.int64(5)"
]
},
"execution_count": 15,
@ -779,7 +779,7 @@
{
"data": {
"text/plain": [
"6"
"np.int64(6)"
]
},
"execution_count": 28,
@ -1062,7 +1062,7 @@
{
"data": {
"text/plain": [
"1"
"np.int64(1)"
]
},
"execution_count": 39,
@ -1215,9 +1215,7 @@
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"metadata": {},
"output_type": "display_data"
}
],
@ -1254,9 +1252,7 @@
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"metadata": {},
"output_type": "display_data"
}
],
@ -1303,9 +1299,7 @@
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"metadata": {},
"output_type": "display_data"
}
],
@ -1319,9 +1313,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "intro-to-data-science",
"language": "python",
"name": "python3"
"name": "intro-to-data-science"
},
"language_info": {
"codemirror_mode": {
@ -1333,7 +1327,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.12.4"
},
"toc": {
"base_numbering": 1,

View file

@ -244,9 +244,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "intro-to-data-science",
"language": "python",
"name": "python3"
"name": "intro-to-data-science"
},
"language_info": {
"codemirror_mode": {
@ -258,7 +258,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.12.4"
},
"toc": {
"base_numbering": 1,

View file

@ -32,12 +32,12 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: pandas in /home/webartifex/repos/intro-to-data-science/.venv/lib/python3.8/site-packages (1.3.3)\n",
"Requirement already satisfied: numpy>=1.17.3 in /home/webartifex/repos/intro-to-data-science/.venv/lib/python3.8/site-packages (from pandas) (1.21.1)\n",
"Requirement already satisfied: python-dateutil>=2.7.3 in /home/webartifex/repos/intro-to-data-science/.venv/lib/python3.8/site-packages (from pandas) (2.8.2)\n",
"Requirement already satisfied: pytz>=2017.3 in /home/webartifex/repos/intro-to-data-science/.venv/lib/python3.8/site-packages (from pandas) (2021.3)\n",
"Requirement already satisfied: six>=1.5 in /home/webartifex/repos/intro-to-data-science/.venv/lib/python3.8/site-packages (from python-dateutil>=2.7.3->pandas) (1.16.0)\n",
"Note: you may need to restart the kernel to use updated packages.\n"
"Requirement already satisfied: pandas in /home/instructor/Repositories/intro-to-data-science/.venv/lib/python3.12/site-packages (2.2.2)\n",
"Requirement already satisfied: numpy>=1.26.0 in /home/instructor/Repositories/intro-to-data-science/.venv/lib/python3.12/site-packages (from pandas) (2.0.0)\n",
"Requirement already satisfied: python-dateutil>=2.8.2 in /home/instructor/Repositories/intro-to-data-science/.venv/lib/python3.12/site-packages (from pandas) (2.9.0.post0)\n",
"Requirement already satisfied: pytz>=2020.1 in /home/instructor/Repositories/intro-to-data-science/.venv/lib/python3.12/site-packages (from pandas) (2024.1)\n",
"Requirement already satisfied: tzdata>=2022.7 in /home/instructor/Repositories/intro-to-data-science/.venv/lib/python3.12/site-packages (from pandas) (2024.1)\n",
"Requirement already satisfied: six>=1.5 in /home/instructor/Repositories/intro-to-data-science/.venv/lib/python3.12/site-packages (from python-dateutil>=2.8.2->pandas) (1.16.0)\n"
]
}
],
@ -927,7 +927,7 @@
"output_type": "stream",
"text": [
"<class 'pandas.core.frame.DataFrame'>\n",
"Int64Index: 694 entries, 192594 to 211519\n",
"Index: 694 entries, 192594 to 211519\n",
"Data columns (total 19 columns):\n",
" # Column Non-Null Count Dtype \n",
"--- ------ -------------- ----- \n",
@ -1882,7 +1882,7 @@
"output_type": "stream",
"text": [
"<class 'pandas.core.frame.DataFrame'>\n",
"Int64Index: 694 entries, 192594 to 211519\n",
"Index: 694 entries, 192594 to 211519\n",
"Data columns (total 19 columns):\n",
" # Column Non-Null Count Dtype \n",
"--- ------ -------------- ----- \n",
@ -2006,7 +2006,7 @@
"output_type": "stream",
"text": [
"<class 'pandas.core.frame.DataFrame'>\n",
"Int64Index: 694 entries, 192594 to 211519\n",
"Index: 694 entries, 192594 to 211519\n",
"Data columns (total 19 columns):\n",
" # Column Non-Null Count Dtype \n",
"--- ------ -------------- ----- \n",
@ -3189,6 +3189,7 @@
{
"data": {
"text/plain": [
"restaurant_id\n",
"1254 78\n",
"1207 47\n",
"1204 39\n",
@ -3199,7 +3200,7 @@
"1249 23\n",
"1242 19\n",
"1221 18\n",
"Name: restaurant_id, dtype: int64"
"Name: count, dtype: int64"
]
},
"execution_count": 35,
@ -3219,6 +3220,7 @@
{
"data": {
"text/plain": [
"customer_id\n",
"73919 14\n",
"10298 12\n",
"6037 8\n",
@ -3229,7 +3231,7 @@
"76838 3\n",
"75905 3\n",
"74791 3\n",
"Name: customer_id, dtype: int64"
"Name: count, dtype: int64"
]
},
"execution_count": 36,
@ -3258,7 +3260,7 @@
{
"data": {
"text/plain": [
"15924.78"
"np.float64(15924.78)"
]
},
"execution_count": 37,
@ -3278,7 +3280,7 @@
{
"data": {
"text/plain": [
"885.0"
"np.float64(885.0)"
]
},
"execution_count": 38,
@ -3301,7 +3303,7 @@
{
"data": {
"text/plain": [
"3.5"
"np.float64(3.5)"
]
},
"execution_count": 39,
@ -3321,7 +3323,7 @@
{
"data": {
"text/plain": [
"83.7"
"np.float64(83.7)"
]
},
"execution_count": 40,
@ -3341,7 +3343,7 @@
{
"data": {
"text/plain": [
"12.5"
"np.float64(12.5)"
]
},
"execution_count": 41,
@ -3364,7 +3366,7 @@
{
"data": {
"text/plain": [
"60.0"
"np.float64(60.0)"
]
},
"execution_count": 42,
@ -3387,7 +3389,7 @@
{
"data": {
"text/plain": [
"22.94636887608069"
"np.float64(22.94636887608069)"
]
},
"execution_count": 43,
@ -3407,7 +3409,7 @@
{
"data": {
"text/plain": [
"22.95"
"np.float64(22.95)"
]
},
"execution_count": 44,
@ -3427,7 +3429,7 @@
{
"data": {
"text/plain": [
"22.69"
"np.float64(22.69)"
]
},
"execution_count": 45,
@ -3445,9 +3447,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "intro-to-data-science",
"language": "python",
"name": "python3"
"name": "intro-to-data-science"
},
"language_info": {
"codemirror_mode": {
@ -3459,7 +3461,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.12.4"
},
"toc": {
"base_numbering": 1,

View file

@ -180,9 +180,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "intro-to-data-science",
"language": "python",
"name": "python3"
"name": "intro-to-data-science"
},
"language_info": {
"codemirror_mode": {
@ -194,7 +194,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.12.4"
},
"toc": {
"base_numbering": 1,

View file

@ -194,6 +194,7 @@
"text/plain": [
"['DESCR',\n",
" 'data',\n",
" 'data_module',\n",
" 'feature_names',\n",
" 'filename',\n",
" 'frame',\n",
@ -511,9 +512,7 @@
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"metadata": {},
"output_type": "display_data"
}
],
@ -552,9 +551,7 @@
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"metadata": {},
"output_type": "display_data"
}
],
@ -606,9 +603,7 @@
"<Figure size 576x576 with 16 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"metadata": {},
"output_type": "display_data"
}
],
@ -959,7 +954,7 @@
{
"data": {
"text/plain": [
"0.9333333333333333"
"np.float64(0.9333333333333333)"
]
},
"execution_count": 26,
@ -986,7 +981,7 @@
{
"data": {
"text/plain": [
"0.9523809523809523"
"np.float64(0.9523809523809523)"
]
},
"execution_count": 27,
@ -1019,9 +1014,7 @@
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"metadata": {},
"output_type": "display_data"
}
],
@ -1150,9 +1143,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "intro-to-data-science",
"language": "python",
"name": "python3"
"name": "intro-to-data-science"
},
"language_info": {
"codemirror_mode": {
@ -1164,7 +1157,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.12.4"
},
"toc": {
"base_numbering": 1,