Skip to content

Commit 835226f

Browse files
2021 december edition - update materials (#149)
1 parent b272f37 commit 835226f

File tree

85 files changed

+14128
-151833
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+14128
-151833
lines changed

_solved/00-jupyter_introduction.ipynb

Lines changed: 65 additions & 350 deletions
Large diffs are not rendered by default.

_solved/case1_bike_count.ipynb

Lines changed: 100 additions & 129 deletions
Large diffs are not rendered by default.

_solved/case2_observations.ipynb

Lines changed: 4375 additions & 0 deletions
Large diffs are not rendered by default.

_solved/case2_observations_analysis.ipynb

Lines changed: 878 additions & 100 deletions
Large diffs are not rendered by default.

_solved/case2_observations_processing.ipynb

Lines changed: 986 additions & 814 deletions
Large diffs are not rendered by default.

_solved/case3_bacterial_resistance_lab_experiment.ipynb

Lines changed: 258 additions & 479 deletions
Large diffs are not rendered by default.

_solved/case4_air_quality_analysis.ipynb

Lines changed: 125 additions & 45 deletions
Large diffs are not rendered by default.

_solved/case4_air_quality_processing.ipynb

Lines changed: 73 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
"source": [
77
"<p><font size=\"6\"><b> CASE - air quality data of European monitoring stations (AirBase)</b></font></p>\n",
88
"\n",
9-
"> *DS Data manipulation, analysis and visualization in Python* \n",
10-
"> *May/June, 2021*\n",
11-
">\n",
129
"> *© 2021, Joris Van den Bossche and Stijn Van Hoey (<mailto:[email protected]>, <mailto:[email protected]>). Licensed under [CC BY 4.0 Creative Commons](http://creativecommons.org/licenses/by/4.0/)*\n",
1310
"\n",
1411
"---"
@@ -344,7 +341,9 @@
344341
"cell_type": "code",
345342
"execution_count": 6,
346343
"metadata": {
347-
"clear_cell": true
344+
"tags": [
345+
"nbtutor-solution"
346+
]
348347
},
349348
"outputs": [],
350349
"source": [
@@ -356,8 +355,10 @@
356355
"cell_type": "code",
357356
"execution_count": 7,
358357
"metadata": {
359-
"clear_cell": true,
360-
"scrolled": true
358+
"scrolled": true,
359+
"tags": [
360+
"nbtutor-solution"
361+
]
361362
},
362363
"outputs": [
363364
{
@@ -570,9 +571,11 @@
570571
"source": [
571572
"<div class=\"alert alert-success\">\n",
572573
"\n",
573-
"<b>EXERCISE</b>:\n",
574-
"<br><br>\n",
575-
"Drop all 'flag' columns ('flag1', 'flag2', ...)"
574+
"**EXERCISE**:\n",
575+
"\n",
576+
"Drop all 'flag' columns ('flag1', 'flag2', ...)\n",
577+
"\n",
578+
"</div>"
576579
]
577580
},
578581
{
@@ -589,8 +592,10 @@
589592
"cell_type": "code",
590593
"execution_count": 9,
591594
"metadata": {
592-
"clear_cell": true,
593-
"scrolled": true
595+
"scrolled": true,
596+
"tags": [
597+
"nbtutor-solution"
598+
]
594599
},
595600
"outputs": [],
596601
"source": [
@@ -912,7 +917,9 @@
912917
"cell_type": "code",
913918
"execution_count": 11,
914919
"metadata": {
915-
"clear_cell": true
920+
"tags": [
921+
"nbtutor-solution"
922+
]
916923
},
917924
"outputs": [
918925
{
@@ -1006,7 +1013,9 @@
10061013
"cell_type": "code",
10071014
"execution_count": 12,
10081015
"metadata": {
1009-
"clear_cell": true
1016+
"tags": [
1017+
"nbtutor-solution"
1018+
]
10101019
},
10111020
"outputs": [
10121021
{
@@ -1038,7 +1047,9 @@
10381047
"cell_type": "code",
10391048
"execution_count": 13,
10401049
"metadata": {
1041-
"clear_cell": true
1050+
"tags": [
1051+
"nbtutor-solution"
1052+
]
10421053
},
10431054
"outputs": [
10441055
{
@@ -1134,7 +1145,9 @@
11341145
"cell_type": "code",
11351146
"execution_count": 14,
11361147
"metadata": {
1137-
"clear_cell": true
1148+
"tags": [
1149+
"nbtutor-solution"
1150+
]
11381151
},
11391152
"outputs": [],
11401153
"source": [
@@ -1146,7 +1159,9 @@
11461159
"cell_type": "code",
11471160
"execution_count": 15,
11481161
"metadata": {
1149-
"clear_cell": true
1162+
"tags": [
1163+
"nbtutor-solution"
1164+
]
11501165
},
11511166
"outputs": [
11521167
{
@@ -1222,7 +1237,9 @@
12221237
"cell_type": "code",
12231238
"execution_count": 16,
12241239
"metadata": {
1225-
"clear_cell": true
1240+
"tags": [
1241+
"nbtutor-solution"
1242+
]
12261243
},
12271244
"outputs": [],
12281245
"source": [
@@ -1433,7 +1450,9 @@
14331450
"cell_type": "code",
14341451
"execution_count": 21,
14351452
"metadata": {
1436-
"clear_cell": true
1453+
"tags": [
1454+
"nbtutor-solution"
1455+
]
14371456
},
14381457
"outputs": [],
14391458
"source": [
@@ -1525,9 +1544,7 @@
15251544
{
15261545
"cell_type": "code",
15271546
"execution_count": 25,
1528-
"metadata": {
1529-
"clear_cell": false
1530-
},
1547+
"metadata": {},
15311548
"outputs": [
15321549
{
15331550
"data": {
@@ -1610,48 +1627,55 @@
16101627
"source": [
16111628
"<div class=\"alert alert-success\">\n",
16121629
"\n",
1613-
"<b>EXERCISE</b>:\n",
1630+
"**EXERCISE**:\n",
16141631
"\n",
1615-
" <ul>\n",
1616-
" <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",
1617-
"</ul>\n",
1632+
"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",
1633+
"\n",
1634+
"<details><summary>Hints</summary>\n",
1635+
"\n",
1636+
"- 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",
1637+
"\n",
1638+
"</details> \n",
1639+
"\n",
1640+
" \n",
16181641
"</div>"
16191642
]
16201643
},
16211644
{
16221645
"cell_type": "code",
1623-
"execution_count": 26,
1624-
"metadata": {
1625-
"clear_cell": false
1626-
},
1646+
"execution_count": 9,
1647+
"metadata": {},
16271648
"outputs": [],
16281649
"source": [
1629-
"import glob"
1650+
"from pathlib import Path"
16301651
]
16311652
},
16321653
{
16331654
"cell_type": "code",
1634-
"execution_count": 27,
1655+
"execution_count": 10,
16351656
"metadata": {
1636-
"clear_cell": true
1657+
"tags": [
1658+
"nbtutor-solution"
1659+
]
16371660
},
16381661
"outputs": [
16391662
{
16401663
"data": {
16411664
"text/plain": [
1642-
"['data/FR040120000800100hour.1-1-1999.31-12-2012',\n",
1643-
" 'data/FR040370000800100hour.1-1-1999.31-12-2012',\n",
1644-
" 'data/BETN0290000800100hour.1-1-1990.31-12-2012',\n",
1645-
" 'data/BETR8010000800100hour.1-1-1990.31-12-2012']"
1665+
"[PosixPath('data/BETN0290000800100hour.1-1-1990.31-12-2012'),\n",
1666+
" PosixPath('data/FR040120000800100hour.1-1-1999.31-12-2012'),\n",
1667+
" PosixPath('data/FR040370000800100hour.1-1-1999.31-12-2012'),\n",
1668+
" PosixPath('data/BETR8010000800100hour.1-1-1990.31-12-2012')]"
16461669
]
16471670
},
1648-
"execution_count": 27,
1671+
"execution_count": 10,
16491672
"metadata": {},
16501673
"output_type": "execute_result"
16511674
}
16521675
],
16531676
"source": [
1654-
"data_files = glob.glob(\"data/*0008001*\")\n",
1677+
"data_folder = Path(\"./data\")\n",
1678+
"data_files = list(data_folder.glob(\"*0008001*\"))\n",
16551679
"data_files"
16561680
]
16571681
},
@@ -1675,7 +1699,9 @@
16751699
"cell_type": "code",
16761700
"execution_count": 28,
16771701
"metadata": {
1678-
"clear_cell": true
1702+
"tags": [
1703+
"nbtutor-solution"
1704+
]
16791705
},
16801706
"outputs": [],
16811707
"source": [
@@ -1691,7 +1717,9 @@
16911717
"cell_type": "code",
16921718
"execution_count": 29,
16931719
"metadata": {
1694-
"clear_cell": true
1720+
"tags": [
1721+
"nbtutor-solution"
1722+
]
16951723
},
16961724
"outputs": [],
16971725
"source": [
@@ -1816,8 +1844,11 @@
18161844
}
18171845
],
18181846
"metadata": {
1847+
"jupytext": {
1848+
"formats": "ipynb,md:myst"
1849+
},
18191850
"kernelspec": {
1820-
"display_name": "Python 3",
1851+
"display_name": "Python 3 (ipykernel)",
18211852
"language": "python",
18221853
"name": "python3"
18231854
},
@@ -1831,7 +1862,7 @@
18311862
"name": "python",
18321863
"nbconvert_exporter": "python",
18331864
"pygments_lexer": "ipython3",
1834-
"version": "3.8.10"
1865+
"version": "3.9.7"
18351866
},
18361867
"nav_menu": {},
18371868
"toc": {

0 commit comments

Comments
 (0)