Week 1 by Koen

This commit is contained in:
Koen Vendrig
2022-02-15 16:37:25 +01:00
parent 37d483a5fa
commit a8d2a8d775
4 changed files with 13446 additions and 74 deletions

View File

@ -41,7 +41,7 @@
"id": "b4d38256",
"metadata": {},
"source": [
"team_members = \"Koen Vendrig, Kees van Kempen\""
"team_members = \"Kees van Kempen, Koen Vendrig\""
]
},
{
@ -90,18 +90,27 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Hello Malte/Yann/Taha, is this okay?\n"
"Hoi Yann, hoe was Japan?\n"
]
}
],
"source": [
"print(\"Hello Malte/Yann/Taha, is this okay?\")"
"# Test code\n",
"print(\"Hoi Yann, hoe was Japan?\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "86e78dbb",
"id": "28242874",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "3c4836ec",
"metadata": {},
"outputs": [],
"source": []
@ -109,7 +118,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},

File diff suppressed because it is too large Load Diff

View File

@ -39,7 +39,7 @@
"cell_type": "raw",
"metadata": {},
"source": [
"team_members = \"Koen Vendrig, Kees van Kempen\""
"team_members = \"Kees van Kempen, Koen Vendrig\""
]
},
{
@ -69,8 +69,7 @@
]
},
{
"cell_type": "code",
"execution_count": 1,
"cell_type": "markdown",
"metadata": {
"deletable": false,
"nbgrader": {
@ -85,7 +84,6 @@
"task": false
}
},
"outputs": [],
"source": [
"import numpy as np\n",
"import scipy.special\n",
@ -116,7 +114,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {
"deletable": false,
"nbgrader": {
@ -132,6 +130,17 @@
}
},
"outputs": [],
"source": [
"import numpy as np\n",
"import scipy.special\n",
"from matplotlib import pyplot as plt"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"def getEuler0(N):\n",
" \"\"\"\n",
@ -171,27 +180,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"75.4 ms ± 368 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n",
"25.8 µs ± 8.69 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n"
]
}
],
"source": [
"# It really does seem that the loop in getEuler0 is terribly slow:\n",
"%timeit -n10 getEuler0(2000)\n",
"%timeit -n10 getEuler1(2000)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"metadata": {
"deletable": false,
"nbgrader": {
@ -206,6 +195,26 @@
"task": false
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"76.2 ms ± 486 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n",
"25.5 µs ± 6.91 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n"
]
}
],
"source": [
"# It really does seem that the loop in getEuler0 is terribly slow:\n",
"%timeit -n10 getEuler0(2000)\n",
"%timeit -n10 getEuler1(2000)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
@ -235,7 +244,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 7,
"metadata": {
"deletable": false,
"editable": false,
@ -286,7 +295,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 8,
"metadata": {
"deletable": false,
"nbgrader": {
@ -322,7 +331,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 9,
"metadata": {
"deletable": false,
"nbgrader": {
@ -368,7 +377,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 10,
"metadata": {
"deletable": false,
"editable": false,
@ -425,7 +434,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 11,
"metadata": {
"deletable": false,
"nbgrader": {
@ -455,18 +464,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"d_list = np.arange(1, 5)\n",
"x = np.arange(30)\n",
"eulerErrs = [getEulerErr(np.array([getEulerRounding(N, d) for N in x])) for d in d_list]"
]
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 12,
"metadata": {
"deletable": false,
"nbgrader": {
@ -481,6 +479,17 @@
"task": false
}
},
"outputs": [],
"source": [
"d_list = np.arange(1, 5)\n",
"x = np.arange(30)\n",
"eulerErrs = [getEulerErr(np.array([getEulerRounding(N, d) for N in x])) for d in d_list]"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
@ -508,7 +517,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 14,
"metadata": {
"deletable": false,
"editable": false,
@ -566,11 +575,18 @@
"c = round(a, 2)\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},

File diff suppressed because one or more lines are too long