-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
237 changed files
with
34,877 additions
and
14,437 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Module 2\n", | ||
"\n", | ||
"in this modules, we will explore the following concepts\n", | ||
"\n", | ||
"1. Dictionaries & Sets\n", | ||
"2. Dataframes\n", | ||
"3. Numpy\n", | ||
"4. Visualizations" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"language_info": { | ||
"name": "python" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,300 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "1ab533bc-63d7-4c28-9482-176cb447ac54", | ||
"metadata": {}, | ||
"source": [ | ||
"# Exercises about dictionaries, sets, dataframes, arrays and visualizations" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "39ef4c7d-6ddc-4119-b2b8-54088051d957", | ||
"metadata": {}, | ||
"source": [ | ||
"## Dictionaries and sets" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "7149dfaa-0417-4c7d-95c3-8e7d3e12e5ff", | ||
"metadata": {}, | ||
"source": [ | ||
"**Exercise**: Take the list of reactors below and create a dictionary where the keys are the elements in the list (the reactors), and the values are the indexes of the elements in the list.\n", | ||
"You can do this by using both a for loop or a list comprehension.\n", | ||
"\n", | ||
"Your result should look like this:\n", | ||
"- dict_reactors = {'batch': 0, 'continuous stirred tank': 1, 'plug flow': 2}\n", | ||
"\n", | ||
"\n", | ||
"Level: <span style=\"color:green\">Easy</span>." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "ca455779-70dd-44da-a827-a85eeef8c594", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"list_reactors = ['batch', 'continuous stirred tank', 'plug flow']\n", | ||
"\n", | ||
"# Your code here" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "048c509f-df22-4781-9cf7-6638b2d036ee", | ||
"metadata": {}, | ||
"source": [ | ||
"Now do the same exercise as above, but instead of the index, the values should be properties of the various reactors!\n", | ||
"\n", | ||
"\n", | ||
"Level: <span style=\"color:green\">Easy</span>." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "6ebfcbc9-50c3-44c1-b972-19dc01e5c59d", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Your code here" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "ea036b2d-2573-4ea9-8350-f17de29f212a", | ||
"metadata": {}, | ||
"source": [ | ||
"**Exercise**: find the set of the list below.\n", | ||
"\n", | ||
"Level: <span style=\"color:green\">Easy</span>." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "3c7f1f9d-6f4a-481b-950e-b3bd91dd6f0a", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"list_reactors = ['batch', 'continuous stirred tank', 'plug flow', 'batch']\n", | ||
"\n", | ||
"# Your code here" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "609c2fa8-9c9c-4f8b-9cea-27570dba301e", | ||
"metadata": {}, | ||
"source": [ | ||
"**Exercise**: Find the (i) intersection and (ii) union of the lists given below.\n", | ||
"\n", | ||
"Level: <span style=\"color:green\">Easy</span>." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"id": "961477f9-d4a8-4994-985e-a69b315635f7", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"['batch']" | ||
] | ||
}, | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"reactors1 = ['batch', 'continuous stirred tank']\n", | ||
"reactors2 = ['plug flow', 'batch']\n", | ||
"\n", | ||
"# Your code here\n", | ||
"\n", | ||
"list(set(reactors1).intersection(set(reactors2)))" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"id": "703372f3-0f81-4403-be43-e730d5b17205", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"['batch']" | ||
] | ||
}, | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"list(set(reactors1) & set(reactors2))" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "a41492a0-37a4-4227-922f-c05a5901571c", | ||
"metadata": {}, | ||
"source": [ | ||
"## DataFrames, arrays and plotting" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "f926889e-b7f0-4d5f-af6c-a6261dc4b7dc", | ||
"metadata": {}, | ||
"source": [ | ||
"In the folder, you can load the .csv file 'packed_column_2.csv'.\n", | ||
"\n", | ||
"**Exercise**: load the data in `pandas`, visualize the top 7 rows of the DataFrame, calculate mean, sum, median of the columns and describe the DataFrame.\n", | ||
"\n", | ||
"Level: <span style=\"color:green\">Easy</span>." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "7fc4a022-6567-4ddb-83e0-05b70cbe3a0b", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import pandas as pd\n", | ||
"\n", | ||
"# Your code here" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "beed64aa-6e1f-431d-84ac-1f0271162cb6", | ||
"metadata": {}, | ||
"source": [ | ||
"**Exercise**: plot the data, remembering to add a title, axis labels and the legend. Try to make your plot as informative (and pretty) as possible.\n", | ||
"\n", | ||
"Level: <span style=\"color:green\">Easy</span>." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "3a9bf1c8-224b-4514-b272-ecc0705d2486", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"%matplotlib inline\n", | ||
"import matplotlib.pyplot as plt\n", | ||
"\n", | ||
"# Your code here" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "56197752-e6da-4ba8-b8fa-fdf80c11872a", | ||
"metadata": {}, | ||
"source": [ | ||
"**Exercise**: import the data we worked with in the theory ('week02/htory/packed_column.csv') and compare the two DataFrames using `pandas` functions. Create a plot (plot can be done with matplotlib) for each water flow in the two dataframes (e.g., one plot with 0 kg/h water flow in column 1 and in column 2).\n", | ||
"\n", | ||
"Level: <span style=\"color:orange\">Medium</span>." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "f58b607e-c50f-4335-acfd-482360c8691e", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Your code here" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "8bf0f902-c4cd-4538-bfb9-eabff06fc482", | ||
"metadata": {}, | ||
"source": [ | ||
"**Exercise**: convert the two DataFrames to numpy arrays and compare them (e.g., calculate the mean, sum, etc).\n", | ||
"\n", | ||
"Level: <span style=\"color:green\">Easy</span>." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "af3d38a5-fd34-487a-9ac5-3ba714bd14a1", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Your code here" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "1769e5b4-d43a-4c10-b2cc-29402006e5cc", | ||
"metadata": {}, | ||
"source": [ | ||
"**Exercise**: what can you conclude from comparing the flow in the two packed columns? Write some text in markdown." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "ab7a6a1c-949b-422d-8e0d-4057269f6360", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# write here\n", | ||
"# remember to make this a markdown cell" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "18a4fd51-3734-4e54-bd40-0052ed1d001a", | ||
"metadata": {}, | ||
"source": [ | ||
"**Exercise**: explore the data as you want, plot it, investigate it, have fun with it!" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "c4d4eba8-896a-4120-a8ef-a4276981a8c2", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Your code here" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.9.7" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
flow type;water flow / air flow;0 kg/h;100 kg/h;200 kg/h;300 kg/h | ||
small;15;0,1;1;1;1 | ||
small;30;2;1;1;2 | ||
small;50;2;1;2;5 | ||
small;80;3;3;5;8 | ||
small;100;4;6;8;13 | ||
big;40;5;10;14;27 | ||
big;50;7;16;21;48 | ||
big;60;9;21;31;117 | ||
big;70;13;31;47;300 | ||
big;80;17;37;93; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Module 3\n", | ||
"\n", | ||
"in this modules, we will explore the following concepts\n", | ||
"\n", | ||
"1. Operations\n", | ||
"2. Linear Regression\n", | ||
"3. Stoichiometry (1)\n", | ||
"4. Stoichiometry (2)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"language_info": { | ||
"name": "python" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Oops, something went wrong.