Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
415 changes: 65 additions & 350 deletions _solved/00-jupyter_introduction.ipynb

Large diffs are not rendered by default.

229 changes: 100 additions & 129 deletions _solved/case1_bike_count.ipynb

Large diffs are not rendered by default.

4,375 changes: 4,375 additions & 0 deletions _solved/case2_observations.ipynb

Large diffs are not rendered by default.

978 changes: 878 additions & 100 deletions _solved/case2_observations_analysis.ipynb

Large diffs are not rendered by default.

1,800 changes: 986 additions & 814 deletions _solved/case2_observations_processing.ipynb

Large diffs are not rendered by default.

737 changes: 258 additions & 479 deletions _solved/case3_bacterial_resistance_lab_experiment.ipynb

Large diffs are not rendered by default.

170 changes: 125 additions & 45 deletions _solved/case4_air_quality_analysis.ipynb

Large diffs are not rendered by default.

115 changes: 73 additions & 42 deletions _solved/case4_air_quality_processing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
"source": [
"<p><font size=\"6\"><b> CASE - air quality data of European monitoring stations (AirBase)</b></font></p>\n",
"\n",
"> *DS Data manipulation, analysis and visualization in Python* \n",
"> *May/June, 2021*\n",
">\n",
"> *© 2021, Joris Van den Bossche and Stijn Van Hoey (<mailto:jorisvandenbossche@gmail.com>, <mailto:stijnvanhoey@gmail.com>). Licensed under [CC BY 4.0 Creative Commons](http://creativecommons.org/licenses/by/4.0/)*\n",
"\n",
"---"
Expand Down Expand Up @@ -344,7 +341,9 @@
"cell_type": "code",
"execution_count": 6,
"metadata": {
"clear_cell": true
"tags": [
"nbtutor-solution"
]
},
"outputs": [],
"source": [
Expand All @@ -356,8 +355,10 @@
"cell_type": "code",
"execution_count": 7,
"metadata": {
"clear_cell": true,
"scrolled": true
"scrolled": true,
"tags": [
"nbtutor-solution"
]
},
"outputs": [
{
Expand Down Expand Up @@ -570,9 +571,11 @@
"source": [
"<div class=\"alert alert-success\">\n",
"\n",
"<b>EXERCISE</b>:\n",
"<br><br>\n",
"Drop all 'flag' columns ('flag1', 'flag2', ...)"
"**EXERCISE**:\n",
"\n",
"Drop all 'flag' columns ('flag1', 'flag2', ...)\n",
"\n",
"</div>"
]
},
{
Expand All @@ -589,8 +592,10 @@
"cell_type": "code",
"execution_count": 9,
"metadata": {
"clear_cell": true,
"scrolled": true
"scrolled": true,
"tags": [
"nbtutor-solution"
]
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -912,7 +917,9 @@
"cell_type": "code",
"execution_count": 11,
"metadata": {
"clear_cell": true
"tags": [
"nbtutor-solution"
]
},
"outputs": [
{
Expand Down Expand Up @@ -1006,7 +1013,9 @@
"cell_type": "code",
"execution_count": 12,
"metadata": {
"clear_cell": true
"tags": [
"nbtutor-solution"
]
},
"outputs": [
{
Expand Down Expand Up @@ -1038,7 +1047,9 @@
"cell_type": "code",
"execution_count": 13,
"metadata": {
"clear_cell": true
"tags": [
"nbtutor-solution"
]
},
"outputs": [
{
Expand Down Expand Up @@ -1134,7 +1145,9 @@
"cell_type": "code",
"execution_count": 14,
"metadata": {
"clear_cell": true
"tags": [
"nbtutor-solution"
]
},
"outputs": [],
"source": [
Expand All @@ -1146,7 +1159,9 @@
"cell_type": "code",
"execution_count": 15,
"metadata": {
"clear_cell": true
"tags": [
"nbtutor-solution"
]
},
"outputs": [
{
Expand Down Expand Up @@ -1222,7 +1237,9 @@
"cell_type": "code",
"execution_count": 16,
"metadata": {
"clear_cell": true
"tags": [
"nbtutor-solution"
]
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -1433,7 +1450,9 @@
"cell_type": "code",
"execution_count": 21,
"metadata": {
"clear_cell": true
"tags": [
"nbtutor-solution"
]
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -1525,9 +1544,7 @@
{
"cell_type": "code",
"execution_count": 25,
"metadata": {
"clear_cell": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -1610,48 +1627,55 @@
"source": [
"<div class=\"alert alert-success\">\n",
"\n",
"<b>EXERCISE</b>:\n",
"**EXERCISE**:\n",
"\n",
" <ul>\n",
" <li>Use the <code>glob.glob</code> function to list all 4 AirBase data files that are included in the 'data' directory, and call the result <code>data_files</code>.</li>\n",
"</ul>\n",
"Use the [pathlib module](https://docs.python.org/3/library/pathlib.html) `Path` class in combination with the `glob` method to list all 4 AirBase data files that are included in the 'data' directory, and call the result `data_files`.\n",
"\n",
"<details><summary>Hints</summary>\n",
"\n",
"- The pathlib module provides a object oriented way to handle file paths. First, create a `Path` object of the data folder, `pathlib.Path(\"./data\")`. Next, apply the `glob` function to extract all the files containing `*0008001*` (use wildcard * to say \"any characters\"). The output is a Python generator, which you can collect as a `list()`.\n",
"\n",
"</details> \n",
"\n",
" \n",
"</div>"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {
"clear_cell": false
},
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"import glob"
"from pathlib import Path"
]
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 10,
"metadata": {
"clear_cell": true
"tags": [
"nbtutor-solution"
]
},
"outputs": [
{
"data": {
"text/plain": [
"['data/FR040120000800100hour.1-1-1999.31-12-2012',\n",
" 'data/FR040370000800100hour.1-1-1999.31-12-2012',\n",
" 'data/BETN0290000800100hour.1-1-1990.31-12-2012',\n",
" 'data/BETR8010000800100hour.1-1-1990.31-12-2012']"
"[PosixPath('data/BETN0290000800100hour.1-1-1990.31-12-2012'),\n",
" PosixPath('data/FR040120000800100hour.1-1-1999.31-12-2012'),\n",
" PosixPath('data/FR040370000800100hour.1-1-1999.31-12-2012'),\n",
" PosixPath('data/BETR8010000800100hour.1-1-1990.31-12-2012')]"
]
},
"execution_count": 27,
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data_files = glob.glob(\"data/*0008001*\")\n",
"data_folder = Path(\"./data\")\n",
"data_files = list(data_folder.glob(\"*0008001*\"))\n",
"data_files"
]
},
Expand All @@ -1675,7 +1699,9 @@
"cell_type": "code",
"execution_count": 28,
"metadata": {
"clear_cell": true
"tags": [
"nbtutor-solution"
]
},
"outputs": [],
"source": [
Expand All @@ -1691,7 +1717,9 @@
"cell_type": "code",
"execution_count": 29,
"metadata": {
"clear_cell": true
"tags": [
"nbtutor-solution"
]
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -1816,8 +1844,11 @@
}
],
"metadata": {
"jupytext": {
"formats": "ipynb,md:myst"
},
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -1831,7 +1862,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
"version": "3.9.7"
},
"nav_menu": {},
"toc": {
Expand Down
Loading