Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISC 2024 #180

Merged
merged 91 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
5402b07
Upgrade links to software carpentry to HTTPS
danny-lloyd Jun 11, 2024
d8bb0da
Fix typos in notebook exercises
danny-lloyd Jun 25, 2024
0554df9
Fix some typos
nf679 Aug 13, 2024
494f8a2
Merge branch 'isc2024' into fix-exercise-typos
nf679 Aug 13, 2024
9b10fa1
Merge pull request #179 from danny-lloyd/fix-exercise-typos
nf679 Aug 13, 2024
0eae71c
Merge pull request #177 from danny-lloyd/use-https-links
nf679 Aug 13, 2024
a2aa736
Fix typos
nf679 Aug 13, 2024
df73a77
Put old materials in a file
nf679 Aug 13, 2024
d125fb6
Edit README for python-intro
nf679 Aug 13, 2024
bb57629
Edit README for python-intro
nf679 Aug 13, 2024
e00a547
Edit README
nf679 Aug 14, 2024
001140b
Add extra info to python-intro question:
nf679 Aug 14, 2024
aa3f31f
Reword confusing question
nf679 Aug 14, 2024
d9bf638
Add extra description to answer
nf679 Aug 14, 2024
fe69c2a
Comment out cell for testing
nf679 Aug 14, 2024
8a85437
Update pandas and matplotlib version to match jaspy
nf679 Aug 14, 2024
0f7683f
Edit python-data folder with new material
nf679 Aug 14, 2024
3014fe7
Edit READMEs
nf679 Aug 14, 2024
bf99a70
Edit README
nf679 Aug 14, 2024
4d600ef
Edit README
nf679 Aug 14, 2024
5735107
Edit numpy tutorial link to stable version
nf679 Aug 14, 2024
1bb7ca8
Add notebooks
nf679 Aug 14, 2024
2cf915e
Add content to data ex01
nf679 Aug 14, 2024
e32ac80
Edit README
nf679 Aug 14, 2024
93a0f32
Add tables to README
nf679 Aug 14, 2024
cc43ecf
Edit README
nf679 Aug 29, 2024
e265779
Edit README
nf679 Aug 29, 2024
1db9cbe
Add xarray exercises
nf679 Oct 8, 2024
e5fe900
Generate exercises and start anotating cells to be removed.
amanning9 Oct 8, 2024
9a7f5c2
Add matplotlib exercise
nf679 Oct 10, 2024
cf42b8a
Add numpy exercises
nf679 Oct 15, 2024
a377a0a
Tag answer cells
nf679 Oct 15, 2024
2d685d5
Generate exercises using script
nf679 Oct 15, 2024
feb36bb
Remove exercises that aren't ready
nf679 Oct 15, 2024
b5f8399
Edit matplotlib notebook
nf679 Oct 15, 2024
e3d9341
Fix some typos, add link, and add note to q11
danny-lloyd Oct 28, 2024
9890b64
Add latest exercises
nf679 Oct 29, 2024
31d5f54
NEtCDF exercises
nf679 Nov 1, 2024
83ece59
Compressing data types question
nf679 Nov 1, 2024
99c873c
Add compound data types exercises
nf679 Nov 1, 2024
246440f
Variable length data types exercises
nf679 Nov 1, 2024
32d4511
Add Enum exercise
nf679 Nov 1, 2024
6754179
Stacking exercise
nf679 Nov 1, 2024
40fc813
Add array splitting exercise
nf679 Nov 1, 2024
bdc1e0e
Add copies exercise
nf679 Nov 1, 2024
d8832ca
Update numpy exercises
nf679 Nov 1, 2024
72d6192
Split netcdf notebook into 2
nf679 Nov 6, 2024
83fe54a
Finished drafts of NetCDF exercises
nf679 Nov 6, 2024
de345f3
Add NetCDF exercise notebooks
nf679 Nov 6, 2024
44dfe6d
Merge pull request #182 from danny-lloyd/matplotlib-review
nf679 Nov 6, 2024
60b96cb
Finish NetCDF solution
nf679 Nov 6, 2024
f895efa
Matplotlib exercises
nf679 Nov 6, 2024
ada5a82
Merge pull request #184 from ncasuk/netCDF
nf679 Nov 6, 2024
940b28b
Merge branch 'isc2024' into matplotlib
nf679 Nov 6, 2024
f04dd5d
Merge pull request #181 from ncasuk/matplotlib
nf679 Nov 6, 2024
1fd4018
Edit README sections
nf679 Nov 6, 2024
4361a1c
Rename exercises
nf679 Nov 6, 2024
3690ded
Update README links for basics
nf679 Nov 6, 2024
50c12ca
Renumber basics
nf679 Nov 6, 2024
5cf1a76
Renumber basics solutions
nf679 Nov 6, 2024
c13ab4b
Fix link to solutions
nf679 Nov 6, 2024
a2dafbf
Edit header for consistency
nf679 Nov 6, 2024
2e019db
Add parallel exercises
nf679 Nov 6, 2024
be86d38
Remove typo
nf679 Nov 6, 2024
c45998e
Edit python-data/README.md
nf679 Nov 6, 2024
a9235e9
Edit python-data/README.md
nf679 Nov 6, 2024
8add12e
Edit READMEs and add parallel notebooks
nf679 Nov 6, 2024
a44de13
Edit README
nf679 Nov 6, 2024
ecda852
Renumber exercises
nf679 Nov 6, 2024
e0ad059
Edit README
nf679 Nov 6, 2024
5400c24
Edit README
nf679 Nov 6, 2024
441b11e
Edit README
nf679 Nov 6, 2024
c3c4b74
Edit README
nf679 Nov 6, 2024
5b1e632
Edit satellite data notebook
nf679 Nov 6, 2024
20585a3
Reviewed typos and split numpy into two
danny-lloyd Nov 6, 2024
5baf284
Merge pull request #188 from danny-lloyd/numpy-review
nf679 Nov 7, 2024
70ac62b
Merge pull request #187 from ncasuk/edit-README
nf679 Nov 7, 2024
b55dcaf
Add changes to numpy exercises for consistency
nf679 Nov 7, 2024
70e9cb2
Add question numbers
nf679 Nov 7, 2024
970cb0e
Add question numbers
nf679 Nov 7, 2024
38d16bf
Regen exercises with typo fixes
nf679 Nov 7, 2024
12de671
Generate exercises from solutions
danny-lloyd Nov 7, 2024
c55fb7e
Merge pull request #189 from danny-lloyd/numpy-finalise
nf679 Nov 8, 2024
9d4cc7b
Lots of updates to xarray notebooks.
amanning9 Nov 8, 2024
f70f9a2
Finish fixing up xarray exercises.
amanning9 Nov 8, 2024
066cca1
Run the notebook processor on python-data.
amanning9 Nov 8, 2024
b9d910d
Merge branch 'isc2024' into alex-review-xarray
amanning9 Nov 8, 2024
b3c7a69
Fix typos, READMEs and add question numbers
nf679 Nov 8, 2024
df5a3b4
Generate exercise notebooks
nf679 Nov 8, 2024
b68064f
Merge pull request #190 from ncasuk/alex-review-xarray
nf679 Nov 8, 2024
1ea16cc
Merge pull request #183 from ncasuk/numpy
nf679 Nov 8, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
*.pyo
*__pycache__*
*.ipynb_checkpoints*
environ
4 changes: 2 additions & 2 deletions .scripts/requirements/python-basics-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# These should match the versions in the version of jaspy which will be used for the course.
matplotlib==3.5.3
pandas==2.0.3
matplotlib==3.8.4
pandas==2.2.2
93 changes: 32 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
# Introduction to Scientific Computing course
# Introduction to Scientific Computing course
This repository holds teaching materials for the NCAS Introduction to Scientific Computing course.

## Overview

The course covers:
- Introduction to the Linux shell
- [Presentations and Exercises](https://ncasuk.github.io/ncas-isc-shell/)
- Python Setup
- [Logging in to the JASMIN Notebook Service ](https://github.com/ncasuk/ncas-isc/blob/main/setup/Logging_in_to_the_JASMIN_Notebook_Service.pdf)
- Git and GitHub
- [Presentation](https://github.com/ncasuk/ncas-isc/tree/main/version_control)
- [Exercise](https://github.com/ncasuk/ncas-isc/tree/main/version_control)
- Introduction to Python
- [Python Introduction Slides](https://github.com/ncasuk/ncas-isc/blob/main/python-intro/presentations.md)
- [Exercises - Jupyter Notebooks](https://github.com/ncasuk/ncas-isc/tree/main/python-intro/exercises) | [Solutions](https://github.com/ncasuk/ncas-isc/tree/main/python-intro/solutions)
- Data manipulation and visualisation in Python (Working with Data)
- [Python working with data Slides](https://github.com/ncasuk/ncas-isc/tree/main/python-data/slides)
- [Exercises - Jupyter Notebooks](https://github.com/ncasuk/ncas-isc/tree/main/python-data/notebooks) | [Solutions](https://github.com/ncasuk/ncas-isc/tree/main/python-data/solutions)
- Example code for all python modules
- [Example code for Python (Working with Data)](https://github.com/ncasuk/ncas-isc/tree/main/python-data/example_code)
- [Example data for Python (Working with Data)](https://github.com/ncasuk/ncas-isc/tree/main/python-data/example_data)

## Index
### Overview Presentations
* [Algorithmic thinking](https://github.com/ncasuk/ncas-isc/blob/main/working_practices/Algorithmic_thinking.pdf)
Expand All @@ -37,50 +17,41 @@ The course covers:
* [Exercise and solutions](https://github.com/ncasuk/ncas-isc/blob/main/version_control/01_git_exercise.md)

## Introduction to Python
1. [Running and Quitting](http://swcarpentry.github.io/python-novice-gapminder/01-run-quit.html)
2. [Variables and Assignment](http://swcarpentry.github.io/python-novice-gapminder/02-variables.html)
3. [Data Types and Type Conversion](http://swcarpentry.github.io/python-novice-gapminder/03-types-conversion.html)
4. [Built-in Functions and Help](http://swcarpentry.github.io/python-novice-gapminder/04-built-in.html)
5. [Libraries](http://swcarpentry.github.io/python-novice-gapminder/06-libraries.html)
6. [Reading Tabular Data into DataFrames](http://swcarpentry.github.io/python-novice-gapminder/07-reading-tabular.html)
7. [Pandas DataFrames](http://swcarpentry.github.io/python-novice-gapminder/08-data-frames.html)
8. [Plotting](http://swcarpentry.github.io/python-novice-gapminder/09-plotting.html)
9. [Lists](http://swcarpentry.github.io/python-novice-gapminder/11-lists.html)
10. [For Loops](http://swcarpentry.github.io/python-novice-gapminder/12-for-loops.html)
11. [Conditionals](http://swcarpentry.github.io/python-novice-gapminder/13-conditionals.html)
12. [Looping Over Data Sets](http://swcarpentry.github.io/python-novice-gapminder/14-looping-data-sets.html)
13. [Writing Functions](http://swcarpentry.github.io/python-novice-gapminder/16-writing-functions.html)
14. [Variable Scope](http://swcarpentry.github.io/python-novice-gapminder/17-scope.html)
15. [Programming Style](http://swcarpentry.github.io/python-novice-gapminder/18-style.html)

* [Exercises](https://github.com/ncasuk/ncas-isc/blob/main/python-intro/notebooks) and [Solutions](https://github.com/ncasuk/ncas-isc/blob/main/python-intro/solutions)
| Lesson | Exercise | Solution |
| ------ | -------- | -------- |
| [Running and quitting](https://swcarpentry.github.io/python-novice-gapminder/01-run-quit.html) | [Exercise 01](/python-intro/exercises/ex01_running_notebooks.ipynb) | [Solution 01](/python-intro/solutions/ex01_running_notebooks.ipynb) |
| [Variables and assignment](https://swcarpentry.github.io/python-novice-gapminder/02-variables.html) | [Exercise 02](/python-intro/exercises/ex02_variables_assignment.ipynb) | [Solution 02](/python-intro/solutions/ex02_variables_assignment.ipynb) |
| [Data types and type conversion](https://swcarpentry.github.io/python-novice-gapminder/03-types-conversion.html) | [Exercise 03](/python-intro/exercises/ex03_data_types.ipynb) | [Solution 03](/python-intro/solutions/ex03_data_types.ipynb) |
| [Built-in functions and Help](https://swcarpentry.github.io/python-novice-gapminder/04-built-in.html) | [Exercise 04](/python-intro/exercises/ex04_built_in_functions.ipynb) | [Solution 04](/python-intro/solutions/ex04_built_in_functions.ipynb) |
| [Libraries](https://swcarpentry.github.io/python-novice-gapminder/06-libraries.html) | [Exercise 05](/python-intro/exercises/ex05_libraries.ipynb) | [Solution 05](/python-intro/solutions/ex05_libraries.ipynb) |
| [Reading tabular data into data frames](https://swcarpentry.github.io/python-novice-gapminder/07-reading-tabular.html) | [Exercise 06](/python-intro/exercises/ex06_dataframes.ipynb) | [Solution 06](/python-intro/solutions/ex06_dataframes.ipynb) |
| [Pandas data frames](https://swcarpentry.github.io/python-novice-gapminder/08-data-frames.html) | [Exercise 07](/python-intro/exercises/ex07_pandas_dataframes.ipynb) | [Solution 07](/python-intro/solutions/ex07_pandas_dataframes.ipynb) |
| [Plotting](https://swcarpentry.github.io/python-novice-gapminder/09-plotting.html) | [Exercise 08](/python-intro/exercises/ex08_plotting.ipynb) | [Solution 08](/python-intro/solutions/ex08_plotting.ipynb) |
| [Lists](https://swcarpentry.github.io/python-novice-gapminder/11-lists.html) | [Exercise 09](/python-intro/exercises/ex09_lists.ipynb) | [Solution 09](/python-intro/solutions/ex09_lists.ipynb) |
| [For loops](https://swcarpentry.github.io/python-novice-gapminder/12-for-loops.html) | [Exercise 10](/python-intro/exercises/ex10_for_loops.ipynb) | [Solution 10](/python-intro/solutions/ex10_for_loops.ipynb) |
| [Conditionals](https://swcarpentry.github.io/python-novice-gapminder/13-conditionals.html) | [Exercise 11](/python-intro/exercises/ex11_conditionals.ipynb) | [Solution 11](/python-intro/solutions/ex11_conditionals.ipynb) |
| [Looping over data sets](https://swcarpentry.github.io/python-novice-gapminder/14-looping-data-sets.html) | [Exercise 12](/python-intro/exercises/ex12_looping_data_sets.ipynb) | [Solution 12](/python-intro/solutions/ex12_looping_data_sets.ipynb) |
| [Writing functions](https://swcarpentry.github.io/python-novice-gapminder/16-writing-functions.html) | [Exercise 13](/python-intro/exercises/ex13_writing_functions.ipynb) | [Solution 13](/python-intro/solutions/ex13_writing_functions.ipynb) |
| [Variable scope](https://swcarpentry.github.io/python-novice-gapminder/17-scope.html) | [Exercise 14](/python-intro/exercises/ex14_variable_scope.ipynb) | [Solution 14](/python-intro/solutions/ex14_variable_scope.ipynb) |
| [Programming style](https://swcarpentry.github.io/python-novice-gapminder/18-style.html) | [Exercise 15](/python-intro/exercises/ex15_programming_style.ipynb) | [Solution 15](/python-intro/solutions/ex15_programming_style.ipynb) |
| [Wrap Up / Summary](/python-intro/exercises/ex16_wrap_up.ipynb) |

## Python - Working with Data

### Handling arrays
* [Numpy](https://github.com/ncasuk/ncas-isc/blob/main/python-data/slides/numpy.pdf)
* [Exercises](https://github.com/ncasuk/ncas-isc/blob/main/python-data/notebooks/ex01_numpy_arrays.ipynb) and [Solutions](https://github.com/ncasuk/ncas-isc/blob/main/python-data/solutions/ex01_numpy_arrays_solutions.ipynb)

### Visualisation
* [Matplotlib and cartopy](https://github.com/ncasuk/ncas-isc/blob/main/python-data/slides/matplotlib_and_cartopy.pdf)
* [Exercises](https://github.com/ncasuk/ncas-isc/blob/main/python-data/notebooks/ex02_matplotlib.ipynb) and [Solutions](https://github.com/ncasuk/ncas-isc/blob/main/python-data/solutions/ex02_matplotlib_solutions.ipynb)
| Lesson | Exercise | Solution |
| ------ | -------- | -------- |
| __xarray:__ Introduction to [multidimensional arrays](https://tutorial.xarray.dev/fundamentals/01_data_structures.html), [xarray data structures](https://tutorial.xarray.dev/fundamentals/01_datastructures.html) and [indexing](https://tutorial.xarray.dev/fundamentals/02.1_indexing_Basic.html) | [Exercise 01](/python-data/exercises/ex01_xr_intro.ipynb) [Exercise 01.5](/python-data/exercises/ex01.5_xr_label_based_indexing.ipynb)| [Solution 01](/python-data/solutions/ex01_xarray_intro.ipynb) [Solution 01.5](/python-data/solutions/ex01.5_xr_label_based_indexing.ipynb)|
| __xarray:__ [Plotting](https://tutorial.xarray.dev/fundamentals/04.1_basic_plotting.html) and [Aggregation](https://tutorial.xarray.dev/fundamentals/03.1_computation_with_xarray.html) | [Exercise 02](/python-data/exercises/ex02_xr_plotting.ipynb) [Exercise 02.5](/python-data/exercises/ex02.5_xr_aggregation.ipynb)| [Solution 02](/python-data/solutions/ex02_plotting.ipynb) [Solution 02.5](/python-data/solutions/ex02.5_xr_aggregation.ipynb)|
| __xarray:__ [GroupBy processing](https://tutorial.xarray.dev/fundamentals/03.2_groupby_with_xarray.html) and [masking](https://tutorial.xarray.dev/intermediate/indexing/boolean-masking-indexing.html) | [Exercise 03](/python-data/exercises/ex03_xr_groupby.ipynb) [Exercise 03.5](/python-data/exercises/ex03.5_xr_masking.ipynb)| [Solution 03](/python-data/solutions/ex03_groupby.ipynb) [Solution 03.5](/python-data/solutions/ex03.5_masking.ipynb)|
| [cf-python]() | [Exercise 04](/python-data/exercises/ex04_cf_python.ipynb) | [Solution 04](/python-data/solutions/ex04_cf_python.ipynb) |
| [matplotlib](https://matplotlib.org/stable/users/explain/quick_start.html) | [Exercise 05](/python-data/exercises/ex05_matplotlib.ipynb) | [Solution 05](/python-data/solutions/ex05_matplotlib.ipynb) |
| [numpy](https://numpy.org/doc/stable/user/quickstart.html) | [Exercise 06](/python-data/exercises/ex06_numpy.ipynb) | [Solution 06](/python-data/solutions/ex06_numpy.ipynb) |
| [netCDF4 basics](https://unidata.github.io/netcdf4-python/#tutorial) | [Exercise 07](/python-data/exercises/ex07_netcdf4_basics.ipynb) | [Solution 07](/python-data/solutions/ex07_netcdf4_basics.ipynb) |
| [netCDF advanced](https://unidata.github.io/netcdf4-python/#dealing-with-time-coordinates) | [Exercise 08](/python-data/exercises/ex08_netcdf4_advanced.ipynb) | [Exercise 08](/python-data/solutions/ex08_netcdf4_advanced.ipynb) |
| Weather Exercise | [Exercise 09a](/python-data/exercises/ex09a_weather_api.ipynb) | [Solution 09b](/python-data/solutions/ex09a_weather_api.ipynb) |
| Sentinel Data Exercise | [Exercise 09b](/python-data/exercises/ex09b_satellite_data.ipynb) | [Solution 09b](/python-data/solutions/ex09b_satellite_data.ipynb) |

### Read and Write data
1. [Data formats and metadata - why?](https://github.com/ncasuk/ncas-isc/blob/main/python-data/slides/01_data_formats.pdf)
2. [Text formats](https://github.com/ncasuk/ncas-isc/blob/main/python-data/slides/02_python_text_formats.pdf)
3. [Some more common text formats (at CEDA)](https://github.com/ncasuk/ncas-isc/blob/main/python-data/slides/03_text_formats_ceda.pdf)
4. [Binary formats](https://github.com/ncasuk/ncas-isc/blob/main/python-data/slides/04_binary_formats.pdf)
5. [Overview of NetCDF](https://github.com/ncasuk/ncas-isc/blob/main/python-data/slides/05_netcdf_overview.pdf)
6. [The structure of "Classic" NetCDF files](https://github.com/ncasuk/ncas-isc/blob/main/python-data/slides/06_netcdf_structure.pdf)
7. [`ncgen` and `ncdump` to create/export NetCDF and CDL](https://github.com/ncasuk/ncas-isc/blob/main/python-data/slides/07_ncgen_ncdump_cdl.pdf)
8. [The CF Metadata Conventions (for NetCDF)](https://github.com/ncasuk/ncas-isc/blob/main/python-data/slides/08_cf_metadata_conventions.pdf)
9. [Checking CF-compliance: `cf-checker`](https://github.com/ncasuk/ncas-isc/blob/main/python-data/slides/09_cfchecker.pdf)
10. [Reading NetCDF files with Python: `netCDF4`](https://github.com/ncasuk/ncas-isc/blob/main/python-data/slides/10_read_netcdf_python.pdf)
11. [Creating NetCDF files with Python](https://github.com/ncasuk/ncas-isc/blob/main/python-data/slides/11_create_netcdf_python.pdf)
12. [Reading and writing other formats](https://github.com/ncasuk/ncas-isc/blob/main/python-data/slides/12_python_and_other_formats.pdf)
13. [Viewing NetCDF: `Ncview` and `ncBrowse`](https://github.com/ncasuk/ncas-isc/blob/main/python-data/slides/13_ncview_ncbrowse.pdf)
* [Exercises](https://github.com/ncasuk/ncas-isc/blob/main/python-data/notebooks/ex03_netcdf.ipynb) and [Solutions](https://github.com/ncasuk/ncas-isc/blob/main/python-data/solutions/ex03_netcdf_solutions.ipynb)
* [Weather API Exercise](https://github.com/ncasuk/ncas-isc/blob/main/python-data/notebooks/ex04_weather_api.ipynb) and [Solution](https://github.com/ncasuk/ncas-isc/blob/main/python-data/solutions/ex04_weather_api_solutions.ipynb)

## Useful materials and resources

Expand All @@ -91,4 +62,4 @@ See the [Resources page](resources.md) for links to useful related sites and mat
Feel free to fork this repository on GitHub and re-use these materials however you like.

### Acknowledgements
The foundations of our course are based on the superb materials provided by [Software Carpentry](https://software-carpentry.org/) who we are eternally grateful to.
The foundations of our course are based on the superb materials provided by [Software Carpentry](https://software-carpentry.org/) who we are eternally grateful to.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"source": [
"### Let's create a numpy array from a list.\n",
"\n",
"Create a with values 1 to 10 and assign it to the variable `x`"
"Create a range with values 1 to 10 and assign it to the variable `x`"
]
},
{
Expand Down Expand Up @@ -179,7 +179,7 @@
"Create an array from the list `[2, 3.2, 5.5, -6.4, -2.2, 2.4]` and assign it to the variable `a`\n",
"\n",
"- Do you know what `a[1]` will equal? Print to see.\n",
"- Try print `a[1:4]` to see what that equals."
"- Try printing `a[1:4]` to see what that equals."
]
},
{
Expand Down Expand Up @@ -261,7 +261,7 @@
"\n",
"### Let's interrogate an array to find out it's characteristics\n",
"\n",
"Create a 2-D array of shape (2, 4) containing two lists `range(4)` and `range(10, 14)`, assign it to the vairable `arr`\n",
"Create a 2-D array of shape (2, 4) containing two lists `range(4)` and `range(10, 14)`, assign it to the variable `arr`\n",
"\n",
"- Print the shape of the array\n",
"- Print the size of the array\n",
Expand Down Expand Up @@ -342,7 +342,7 @@
"\n",
"### Let's perform some array calculations\n",
"\n",
"Create a 2-D array of shape (2, 4) containing two lists `range(4)` and `range(10, 14)`, assign it to the vairable `a`\n",
"Create a 2-D array of shape (2, 4) containing two lists `range(4)` and `range(10, 14)`, assign it to the variable `a`\n",
"\n",
"Create an array from a list `[2, -1, 1, 0]` and assign it to the variable `b`\n",
"\n",
Expand Down Expand Up @@ -385,7 +385,7 @@
"\n",
"Create an array of values 0 to 9 and assign it to the variable `arr`\n",
"\n",
"- Print two different way of expressing the condition where the array is less than 3.\n",
"- Print two different ways of expressing the condition where the array is less than 3.\n",
"- Create a numpy condition where `arr` is less than 3 OR greater than 8.\n",
"- Use the `where` function to create a new array where the value is `arr*5` if the above condition is `True` and `arr-5` where the condition is `False`"
]
Expand Down Expand Up @@ -418,7 +418,7 @@
"source": [
"### Let's implement a mathematical function that works on arrays.\n",
"\n",
"Write a function that takes a 2-D array of horizontal zonal (east-west) wind components (`u`, in m/s) and a 2-D array of horizontal meridional (north-south) wind componenets (`v`, in m/s)\n",
"Write a function that takes a 2-D array of horizontal zonal (east-west) wind components (`u`, in m/s) and a 2-D array of horizontal meridional (north-south) wind components (`v`, in m/s)\n",
"and returns an array of the magnitudes of the total wind.\n",
"Include a test for the overall magnitude: if it is less than 0.1 then set it equal to 0.1 (We might presume this particular domain has no non-zero winds and that only winds above 0.1 m/s constitute \"good\" data while those below are indistinguishable from the minimum due to noise)\n",
"\n",
Expand Down Expand Up @@ -534,7 +534,7 @@
"- Print the array to view its values.\n",
"- Print its missing value (i.e. `narr.fill_value`)\n",
"- Print an array that converts `narr` so that the missing values are represented by the missing value (i.e. `MA.filled`). Assign it to `farr`\n",
"- What is the type of the `farr`"
"- What is the type of `farr`?"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
"source": [
"## 3. Plotting gridded data on a map\n",
"\n",
"In this section, we will use `cartopy` - a python module that supports maps and usage with `matplotlib`.\n",
"In this section, we will use `cartopy` - a Python module that supports maps and usage with `matplotlib`.\n",
"\n",
"First, let's grab some data from a NetCDF file and quickly plot it.\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Loop through and print Dataset `variables` names, this is the ID that act like the key to access the Variable."
"Loop through and print Dataset `variables` names, this is the ID that acts like the key to access the variable."
]
},
{
Expand Down Expand Up @@ -314,7 +314,7 @@
"metadata": {},
"source": [
"Create four new Dimensions to `myds` from your previous slices. Re-use the names from the last section.\n",
"Note that the \"level\" and \"time\" Dimensions should have length, \"lat\" length 10 and \"lon\" length 5.\n",
"Note that the \"level\" and \"time\" dimensions should have length 1, \"lat\" length 10 and \"lon\" length 5.\n",
"To create a new Dimension use `myds.createDimension(name, size)`"
]
},
Expand Down
Loading
Loading