-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2023 edition - update materials (#64)
- Loading branch information
1 parent
6ae2cac
commit 1e888a7
Showing
50 changed files
with
674 additions
and
592 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,9 +8,9 @@ | |
"\n", | ||
"\n", | ||
"> *DS Python for GIS and Geoscience* \n", | ||
"> *November, 2022*\n", | ||
"> *September, 2023*\n", | ||
">\n", | ||
"> *© 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", | ||
"> *© 2023, 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", | ||
"\n", | ||
"---" | ||
] | ||
|
@@ -548,7 +548,7 @@ | |
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.6" | ||
"version": "3.11.5" | ||
}, | ||
"nav_menu": {}, | ||
"toc": { | ||
|
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 |
---|---|---|
|
@@ -8,9 +8,9 @@ | |
"\n", | ||
"\n", | ||
"> *DS Python for GIS and Geoscience* \n", | ||
"> *November, 2022*\n", | ||
"> *September, 2023*\n", | ||
">\n", | ||
"> *© 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", | ||
"> *© 2023, 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", | ||
"\n", | ||
"---" | ||
] | ||
|
@@ -231,6 +231,22 @@ | |
"countries.sort_values(by='pop_est')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"<div style=\"border: 5px solid #3776ab; border-radius: 2px; padding: 2em;\">\n", | ||
"\n", | ||
"## Python recap\n", | ||
"\n", | ||
"Python objects have **attributes** and **methods**:\n", | ||
"\n", | ||
"* Attribute: `obj.attribute` (no parentheses!) -> property of the object (pandas examples: `dtypes`, `columns`, `shape`, ..)\n", | ||
"* Method: `obj.method()` (function call with parentheses) -> action (pandas examples: `mean()`, `sort_values()`, ...)\n", | ||
"\n", | ||
"</div>" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
|
@@ -524,7 +540,7 @@ | |
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"Often, you want to select rows based on a certain condition. This can be done with *'boolean indexing'* (like a where clause in SQL). \n", | ||
"Often, you want to select rows based on a certain condition. This can be done with *'boolean indexing'* (like a WHERE clause in SQL).\n", | ||
"\n", | ||
"The indexer (or boolean mask) should be 1-dimensional and the same length as the thing being indexed." | ||
] | ||
|
@@ -1886,6 +1902,7 @@ | |
"metadata": { | ||
"celltoolbar": "Nbtutor - export exercises", | ||
"jupytext": { | ||
"cell_metadata_filter": "-run_control,-deletable,-editable,-jupyter,-slideshow", | ||
"formats": "ipynb,md:myst" | ||
}, | ||
"kernelspec": { | ||
|
@@ -1903,7 +1920,7 @@ | |
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.6" | ||
"version": "3.11.5" | ||
}, | ||
"widgets": { | ||
"application/vnd.jupyter.widget-state+json": { | ||
|
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 |
---|---|---|
|
@@ -8,9 +8,9 @@ | |
"\n", | ||
"\n", | ||
"> *DS Python for GIS and Geoscience* \n", | ||
"> *November, 2022*\n", | ||
"> *September, 2023*\n", | ||
">\n", | ||
"> *© 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", | ||
"> *© 2023, 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", | ||
"\n", | ||
"---" | ||
] | ||
|
@@ -377,7 +377,7 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from shapely.geometry import Point, Polygon, LineString" | ||
"from shapely import Point, Polygon, LineString" | ||
] | ||
}, | ||
{ | ||
|
@@ -1061,6 +1061,9 @@ | |
], | ||
"metadata": { | ||
"celltoolbar": "Nbtutor - export exercises", | ||
"jupytext": { | ||
"cell_metadata_filter": "-run_control,-deletable,-editable,-jupyter,-slideshow" | ||
}, | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
|
@@ -1076,7 +1079,7 @@ | |
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.6" | ||
"version": "3.11.5" | ||
}, | ||
"widgets": { | ||
"application/vnd.jupyter.widget-state+json": { | ||
|
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 |
---|---|---|
|
@@ -8,9 +8,9 @@ | |
"\n", | ||
"\n", | ||
"> *DS Python for GIS and Geoscience* \n", | ||
"> *November, 2022*\n", | ||
"> *September, 2023*\n", | ||
">\n", | ||
"> *© 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", | ||
"> *© 2023, 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", | ||
"\n", | ||
"---" | ||
] | ||
|
@@ -533,6 +533,10 @@ | |
], | ||
"metadata": { | ||
"celltoolbar": "Nbtutor - export exercises", | ||
"jupytext": { | ||
"cell_metadata_filter": "-run_control,-deletable,-editable,-jupyter,-slideshow", | ||
"notebook_metadata_filter": "-jupytext.cell_metadata_filter" | ||
}, | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
|
@@ -548,7 +552,7 @@ | |
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.6" | ||
"version": "3.11.5" | ||
}, | ||
"widgets": { | ||
"application/vnd.jupyter.widget-state+json": { | ||
|
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 |
---|---|---|
|
@@ -8,9 +8,9 @@ | |
"\n", | ||
"\n", | ||
"> *DS Python for GIS and Geoscience* \n", | ||
"> *November, 2022*\n", | ||
"> *September, 2023*\n", | ||
">\n", | ||
"> *© 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", | ||
"> *© 2023, 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", | ||
"\n", | ||
"---" | ||
] | ||
|
@@ -726,7 +726,7 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"france = countries.loc[countries['name'] == 'France', 'geometry'].squeeze()" | ||
"france = countries.loc[countries['name'] == 'France', 'geometry'].item()" | ||
] | ||
}, | ||
{ | ||
|
@@ -1110,6 +1110,9 @@ | |
} | ||
], | ||
"metadata": { | ||
"jupytext": { | ||
"cell_metadata_filter": "-run_control,-deletable,-editable,-jupyter,-slideshow" | ||
}, | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
|
@@ -1125,7 +1128,7 @@ | |
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.6" | ||
"version": "3.11.5" | ||
}, | ||
"widgets": { | ||
"application/vnd.jupyter.widget-state+json": { | ||
|
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 |
---|---|---|
|
@@ -8,9 +8,9 @@ | |
"\n", | ||
"\n", | ||
"> *DS Python for GIS and Geoscience* \n", | ||
"> *November, 2022*\n", | ||
"> *September, 2023*\n", | ||
">\n", | ||
"> *© 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", | ||
"> *© 2023, 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", | ||
"\n", | ||
"---" | ||
] | ||
|
@@ -301,7 +301,7 @@ | |
}, | ||
"outputs": [], | ||
"source": [ | ||
"print(str(africa)[:1000])" | ||
"print(str(africa)[:100])" | ||
] | ||
}, | ||
{ | ||
|
@@ -1411,9 +1411,6 @@ | |
], | ||
"metadata": { | ||
"celltoolbar": "Nbtutor - export exercises", | ||
"jupytext": { | ||
"cell_metadata_filter": "-run_control,-deletable,-editable,-jupyter,-slideshow" | ||
}, | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
|
@@ -1429,7 +1426,7 @@ | |
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.6" | ||
"version": "3.11.5" | ||
}, | ||
"widgets": { | ||
"application/vnd.jupyter.widget-state+json": { | ||
|
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
Oops, something went wrong.