Skip to content

Commit be5d503

Browse files
2022 december edition - update materials (#174)
1 parent 2987dd9 commit be5d503

File tree

82 files changed

+546
-4000
lines changed

Some content is hidden

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

82 files changed

+546
-4000
lines changed

_solved/00-jupyter_introduction.ipynb

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"<p><font size=\"6\"><b>Jupyter notebook INTRODUCTION </b></font></p>\n",
88
"\n",
9-
"> *© 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",
9+
"> *© 2022, 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",
1010
"\n",
1111
"---"
1212
]
@@ -186,20 +186,6 @@
186186
"#### subsubsection"
187187
]
188188
},
189-
{
190-
"cell_type": "markdown",
191-
"metadata": {},
192-
"source": [
193-
"## Raw Text"
194-
]
195-
},
196-
{
197-
"cell_type": "raw",
198-
"metadata": {},
199-
"source": [
200-
"Cfr. any text editor"
201-
]
202-
},
203189
{
204190
"cell_type": "markdown",
205191
"metadata": {},
@@ -554,7 +540,7 @@
554540
"name": "python",
555541
"nbconvert_exporter": "python",
556542
"pygments_lexer": "ipython3",
557-
"version": "3.9.9"
543+
"version": "3.10.4"
558544
},
559545
"nav_menu": {},
560546
"toc": {

_solved/case1_bike_count.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"<p><font size=\"6\"><b> CASE - Bike count data</b></font></p>\n",
88
"\n",
9-
"> *© 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",
9+
"> *© 2022, 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",
1010
"\n",
1111
"---"
1212
]
@@ -187,8 +187,8 @@
187187
"\n",
188188
"Pre-process the data:\n",
189189
"\n",
190-
"* Combine the 'datum' and 'tijd' columns into one Pandas Series of string datetime values, call this new variable `combined`.\n",
191-
"* Parse the string datetime values to `datetime` objects.\n",
190+
"* Combine the 'datum' and 'tijd' columns into one Pandas Series of string values, call this new variable `combined`.\n",
191+
"* Parse the string values to `datetime` objects.\n",
192192
"* Set the resulting `datetime` column as the index of the `df` DataFrame.\n",
193193
"* Remove the original 'datum' and 'tijd' columns using the `drop` method, and call the new dataframe `df2`.\n",
194194
"* Rename the columns in the DataFrame 'ri Centrum', 'ri Mariakerke' to resp. 'direction_centre', 'direction_mariakerke' using the `rename` method.\n",
@@ -1148,7 +1148,7 @@
11481148
"cell_type": "markdown",
11491149
"metadata": {},
11501150
"source": [
1151-
"So the daily pattern is clearly different for both directions. In the morning more people go north, in the evening more people go south. The morning peak is also more condensed."
1151+
"So the daily pattern is clearly different for both directions. In the morning more people go towards the centre, in the evening more people go back to Mariakerke. The morning peak is also more condensed."
11521152
]
11531153
},
11541154
{
@@ -1220,7 +1220,7 @@
12201220
"name": "python",
12211221
"nbconvert_exporter": "python",
12221222
"pygments_lexer": "ipython3",
1223-
"version": "3.10.2"
1223+
"version": "3.10.4"
12241224
},
12251225
"nav_menu": {},
12261226
"toc": {

_solved/case2_observations.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"<p><font size=\"6\"><b>CASE - Observation data</b></font></p>\n",
88
"\n",
9-
"> *© 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",
9+
"> *© 2022, 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",
1010
"\n",
1111
"---"
1212
]
@@ -309,11 +309,11 @@
309309
"\n",
310310
"**EXERCISE**\n",
311311
"\n",
312-
"How many records in the data set have no information about the `species`? Use the `isna()` method to find out.\n",
312+
"How many records in the data set have no information about the `species_ID`? Use the `isna()` method to find out.\n",
313313
"\n",
314314
"<details><summary>Hints</summary>\n",
315315
"\n",
316-
"- Do NOT use `survey_data_processed['species'] == np.nan`, but use the available method `isna()` to check if a value is NaN\n",
316+
"- Do NOT use `survey_data_processed['species_ID'] == np.nan`, but use the available method `isna()` to check if a value is NaN\n",
317317
"- The result of an (element-wise) condition returns a set of True/False values, corresponding to 1/0 values. The amount of True values is equal to the sum.\n",
318318
" \n",
319319
"</details>"
@@ -1673,7 +1673,7 @@
16731673
"name": "python",
16741674
"nbconvert_exporter": "python",
16751675
"pygments_lexer": "ipython3",
1676-
"version": "3.10.2"
1676+
"version": "3.8.13"
16771677
},
16781678
"nav_menu": {},
16791679
"toc": {

_solved/case2_observations_analysis.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"<p><font size=\"6\"><b> CASE - Observation data - analysis</b></font></p>\n",
88
"\n",
9-
"> *© 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",
9+
"> *© 2022, 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",
1010
"\n",
1111
"---"
1212
]
@@ -1319,7 +1319,7 @@
13191319
"name": "python",
13201320
"nbconvert_exporter": "python",
13211321
"pygments_lexer": "ipython3",
1322-
"version": "3.10.2"
1322+
"version": "3.10.4"
13231323
},
13241324
"nav_menu": {},
13251325
"toc": {

_solved/case2_observations_processing.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"<p><font size=\"6\"><b> CASE - Observation data - data cleaning and enrichment</b></font></p>\n",
88
"\n",
9-
"> *© 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",
9+
"> *© 2022, 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",
1010
"\n",
1111
"---"
1212
]
@@ -2274,7 +2274,7 @@
22742274
"name": "python",
22752275
"nbconvert_exporter": "python",
22762276
"pygments_lexer": "ipython3",
2277-
"version": "3.10.2"
2277+
"version": "3.10.4"
22782278
},
22792279
"nav_menu": {},
22802280
"toc": {

_solved/case3_bacterial_resistance_lab_experiment.ipynb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"<p><font size=\"6\"><b>CASE - Bacterial resistance experiment</b></font></p>\n",
88
"\n",
9-
"> *© 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",
9+
"> *© 2022, 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",
1010
"\n",
1111
"---"
1212
]
@@ -525,14 +525,13 @@
525525
"- Make sure the `WT(2)` and `MUT(2)` categories are used as respectively `WT` and `MUT` by adjusting them with Pandas first.\n",
526526
"- Use the __falcor__ data and the Seaborn package. The 'log10 mutation rate' on the figure corresponds to the `log10 Mc` column.\n",
527527
"\n",
528-
"\n",
529528
"<details><summary>Hints</summary>\n",
530529
"\n",
531530
"- To replace values using a mapping (dictionary with the keys the current values and the values the new values), use the Pandas `replace` method.\n",
532531
"- This is another example of a `catplot`, using `point`s to represent the data.\n",
533532
"- The `join` argument defines if individual points need to be connected or not.\n",
534-
"- One combination appears multiple times, so make sure to not yet use confidence intervals by setting `ci` to `Null`.\n",
535-
"\n",
533+
"- Seaborn provides the `row_order` and `order` options to provide a custom order of respectively the subplots and categories.\n",
534+
"- One combination appears multiple times, so make sure to not yet use confidence intervals by setting `errorbar` to `None`.\n",
536535
"</details>"
537536
]
538537
},
@@ -568,7 +567,10 @@
568567
" x='Bacterial_genotype',\n",
569568
" y='log10 Mc',\n",
570569
" row=\"Phage\",\n",
571-
" join=False, ci=None,\n",
570+
" join=False, \n",
571+
" errorbar=None,\n",
572+
" row_order=[\"Lambda\", \"T4\", \"T7\"],\n",
573+
" order=['WT', 'MUT', 'D87G', 'S83L', 'D516G', 'S512F', 'K43N', 'K88R', 'RSF1010', 'RP4'],\n",
572574
" aspect=3, height=3,\n",
573575
" color=\"black\")"
574576
]
@@ -679,7 +681,7 @@
679681
"name": "python",
680682
"nbconvert_exporter": "python",
681683
"pygments_lexer": "ipython3",
682-
"version": "3.10.2"
684+
"version": "3.10.4"
683685
},
684686
"widgets": {
685687
"application/vnd.jupyter.widget-state+json": {

_solved/case4_air_quality_analysis.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"<p><font size=\"6\"><b> CASE - air quality data of European monitoring stations (AirBase)</b></font></p>\n",
88
"\n",
9-
"> *© 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",
9+
"> *© 2022, 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",
1010
"\n",
1111
"---"
1212
]
@@ -1329,7 +1329,7 @@
13291329
"name": "python",
13301330
"nbconvert_exporter": "python",
13311331
"pygments_lexer": "ipython3",
1332-
"version": "3.10.2"
1332+
"version": "3.10.4"
13331333
},
13341334
"nav_menu": {},
13351335
"toc": {

_solved/case4_air_quality_processing.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"<p><font size=\"6\"><b> CASE - air quality data of European monitoring stations (AirBase)</b></font></p>\n",
88
"\n",
9-
"> *© 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",
9+
"> *© 2022, 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",
1010
"\n",
1111
"---"
1212
]
@@ -771,7 +771,7 @@
771771
"name": "python",
772772
"nbconvert_exporter": "python",
773773
"pygments_lexer": "ipython3",
774-
"version": "3.10.2"
774+
"version": "3.10.4"
775775
},
776776
"nav_menu": {},
777777
"toc": {

_solved/pandas_01_data_structures.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"source": [
88
"<p><font size=\"6\"><b>01 - Pandas: Data Structures </b></font></p>\n",
99
"\n",
10-
"> *© 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",
10+
"> *© 2022, 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",
1111
"\n",
1212
"---"
1313
]
@@ -702,7 +702,7 @@
702702
},
703703
"outputs": [],
704704
"source": [
705-
"df['Fare'].plot(kind='box') # or .plot.box()"
705+
"df['Fare'].plot.box() # or .plot(kind='box')"
706706
]
707707
},
708708
{
@@ -765,7 +765,7 @@
765765
"name": "python",
766766
"nbconvert_exporter": "python",
767767
"pygments_lexer": "ipython3",
768-
"version": "3.10.2"
768+
"version": "3.10.8"
769769
},
770770
"widgets": {
771771
"application/vnd.jupyter.widget-state+json": {

_solved/pandas_02_basic_operations.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"<p><font size=\"6\"><b> 02 - Pandas: Basic operations on Series and DataFrames</b></font></p>\n",
99
"\n",
1010
"\n",
11-
"> *© 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",
11+
"> *© 2022, 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",
1212
"\n",
1313
"---"
1414
]
@@ -349,7 +349,7 @@
349349
},
350350
"outputs": [],
351351
"source": [
352-
"df['Age'].hist() #bins=30, log=True"
352+
"df['Age'].plot.hist() # bins=30, log=True)"
353353
]
354354
},
355355
{
@@ -780,7 +780,7 @@
780780
"name": "python",
781781
"nbconvert_exporter": "python",
782782
"pygments_lexer": "ipython3",
783-
"version": "3.10.2"
783+
"version": "3.10.8"
784784
},
785785
"widgets": {
786786
"application/vnd.jupyter.widget-state+json": {

0 commit comments

Comments
 (0)