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

Add draft Lecture_PCA material. #1

Open
wants to merge 248 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
248 commits
Select commit Hold shift + click to select a range
b67f45b
Relocate extra lectures into their own directory
dmay23 Mar 22, 2021
293d160
Move GUI lectures into Supplementary_Lectures
dmay23 Mar 22, 2021
8eb839b
Remove assignment 1 from lecture notebook 3
dmay23 Mar 22, 2021
71c18dc
Move Assignment 2 out of lecture 6
dmay23 Mar 22, 2021
36775fe
Move assignment 3 from lecture 9
dmay23 Mar 22, 2021
cea12e4
Move assignment 4 out of lecture 12
dmay23 Mar 22, 2021
b3e6407
Move assignment 5 out of lecture 15
dmay23 Mar 22, 2021
ecf36ed
Move assignment 6 out of lecture 18
dmay23 Mar 22, 2021
b4c6371
Remove assignments 7,8,9 from lectures 21, 24, 26
dmay23 Mar 22, 2021
e789798
Formatting changes for Assignment 1
dmay23 Mar 22, 2021
fc47e03
Assignment 2: Formatting
dmay23 Mar 22, 2021
6daec5f
Unify assignment styles
dmay23 Mar 22, 2021
09fa64f
Style changes in assignment formatting
dmay23 Mar 22, 2021
4b0a52b
Tweaks to front matter
dmay23 Mar 22, 2021
3bc0cbd
Removed the static table of contents from README.
dmay23 Mar 22, 2021
5b94cfd
Move absolute path to readme for the binder.
dmay23 Mar 22, 2021
4935cbe
Move Anaconda install instructions intro extra lectures
dmay23 Mar 22, 2021
c739c0c
Temp file renaming
dmay23 Mar 23, 2021
70b1071
Lecture re-order (notebooks only)
dmay23 Mar 23, 2021
7335a44
* Updated titles
dmay23 Mar 23, 2021
8dd5d14
_TableOfContents: Correct the titles (order was correct)
dmay23 Mar 23, 2021
26b1db0
Temp file move
dmay23 Mar 23, 2021
d2948b6
Reorder practice problems
dmay23 Mar 23, 2021
338420d
Practice problem titles updated
dmay23 Mar 23, 2021
1fc8dae
Reordered questions for Assignments 6, 7, 8
bcych Mar 23, 2021
7280fe7
Small updates to syllabus, TOC.
dmay23 Mar 26, 2021
6c41c6d
Merge branch 'bcych/Python-for-Earth-Science-Students-2021' into dmay…
dmay23 Mar 26, 2021
17930f0
Trashed checkpoints
dmay23 Mar 26, 2021
34ac398
Ignore checkpoint directories
dmay23 Mar 26, 2021
f77bdc3
Env update
dmay23 Mar 29, 2021
ab26162
TOC update
dmay23 Mar 29, 2021
40bef85
Binder badge in readme
dmay23 Mar 29, 2021
e9296a4
Trim readme, add course specific page.
dmay23 Mar 29, 2021
bcc1f26
Grammar, spelling changes
dmay23 Mar 29, 2021
e49722a
Formatting / grammar change
dmay23 Mar 29, 2021
90ed008
Practice updates
dmay23 Mar 29, 2021
30e2d4e
L3: Minor changes
dmay23 Mar 29, 2021
d007e36
L2: Updates
dmay23 Mar 29, 2021
03cf750
L1: Simplify content a lot to make the students life happier (at leas…
dmay23 Mar 29, 2021
abb3bfb
L1 did not display clean output
dmay23 Mar 29, 2021
be48cb5
Formatting, typo fixes.
dmay23 Mar 30, 2021
1678fd1
Grammar, typos
dmay23 Mar 30, 2021
e8d58b7
Typo
dmay23 Mar 30, 2021
ebe7fae
Header, footer added
dmay23 Mar 30, 2021
4c647ac
Assignments cleanup.
dmay23 Mar 30, 2021
1c7cbf1
Use recommended naming convention
dmay23 Mar 30, 2021
79656fc
Added dataset/
dmay23 Mar 30, 2021
b46d3d7
Filename formatting
dmay23 Mar 30, 2021
c946322
L2: Added statement about built-in conversions.
dmay23 Mar 30, 2021
668a561
L2: clean output
dmay23 Mar 30, 2021
af52085
L3: Use recommended variable names (i will try to practice what i pre…
dmay23 Mar 30, 2021
8d99b8a
A1,A2: Small additions
dmay23 Mar 30, 2021
18619fa
L3: Little more set material - just for fun.
dmay23 Mar 30, 2021
400c65e
L1: Quick note about file extensions.
dmay23 Mar 30, 2021
8eb7bd4
COB -> midnight
dmay23 Mar 31, 2021
0aad536
L3: Code format style
dmay23 Apr 1, 2021
9bf63cc
L3: Typo! Sets can contain any type of object
dmay23 Apr 2, 2021
c23ff64
PP03: Fixed typo (thanks BC)
dmay23 Apr 2, 2021
9bae382
L4 clean up:
dmay23 Apr 4, 2021
ebc7cbc
L5: clean up
dmay23 Apr 4, 2021
3a7319e
L6: Clean up
dmay23 Apr 4, 2021
9af5bdf
PP 04, 05, 06 cleanup
dmay23 Apr 4, 2021
d319293
L5: Lots of formatting inconsistencies with the docstrings.
dmay23 Apr 6, 2021
6c27f83
L6: Better comments, better references
dmay23 Apr 6, 2021
c6533d4
L6: Typos
dmay23 Apr 9, 2021
9c21980
A2: Style change
dmay23 Apr 9, 2021
a799d12
PP 04, 05, 06 had malformatted lists affecting result shown in nbview…
dmay23 Apr 11, 2021
b9b79c5
PP 06: Small formatting change
dmay23 Apr 11, 2021
050102f
PP 07, 08, 09 updates
dmay23 Apr 11, 2021
2db39d0
L7, L8 updates
dmay23 Apr 11, 2021
dc4c578
L9 updates
dmay23 Apr 11, 2021
ec8637f
HW03 updates.
dmay23 Apr 12, 2021
6d2551e
Rename syllabus
dmay23 Apr 12, 2021
d8ad48e
L9: Format tweak
dmay23 Apr 12, 2021
396728e
Hw03: Small formatting change to better structure the work required.
dmay23 Apr 12, 2021
bac6029
L07: Remove sec num from References
dmay23 Apr 14, 2021
0cc7db9
L08: Pandas -> pandas
dmay23 Apr 14, 2021
844e6f0
HW04: Formatting
dmay23 Apr 14, 2021
430ea25
L08: Further references add
dmay23 Apr 14, 2021
c5f1634
L07 has nothing to do with matplotlib...
dmay23 Apr 14, 2021
37d8d96
L09: Formatting updates.
dmay23 Apr 16, 2021
b1fe12b
L09: Small typo in definition of B, C
dmay23 Apr 16, 2021
fc6eb45
L10: Cleanup
dmay23 Apr 16, 2021
f47cca1
L09: Remove duplicate import of numpy.
dmay23 Apr 16, 2021
6ce81d2
L10: Section number corrected
dmay23 Apr 16, 2021
f5c2d89
L10: Heading format
dmay23 Apr 18, 2021
f1dab2f
PP07: For 2022 - we don't want lats.txt uploaded.
dmay23 Apr 18, 2021
35dfbd2
PP10: Formatting
dmay23 Apr 18, 2021
4cada52
PP11, PP12 updates
dmay23 Apr 18, 2021
9da0e60
L11: Remove map, filter, reduced: Replace with exceptions.
dmay23 Apr 18, 2021
fbd7f93
PP12: Namespace methods (otherwise its quite confusing)
dmay23 Apr 18, 2021
edeb687
L12: Updates
dmay23 Apr 18, 2021
ab22454
L11: Slight change in definitions and explaination of what raise does.
dmay23 Apr 19, 2021
0770f6c
PP12, PP13, PP14, PP15 format updates
dmay23 Apr 19, 2021
d872e34
L13 update:
dmay23 Apr 19, 2021
7773d11
L14 updates
dmay23 Apr 19, 2021
1d3c0d9
PP10: Fixed a silly typo regarding length and width.
dmay23 Apr 21, 2021
673f716
PP11: Typo in example filename
dmay23 Apr 21, 2021
dad761f
PP11: Missing period
dmay23 Apr 21, 2021
bef3b91
HW02: Re-word question such that it is clear the module and the funct…
dmay23 Apr 21, 2021
cf299fb
HW04: Updated questions (removed map, added something for exceptions)
dmay23 Apr 22, 2021
caa6efb
Remove stray file
dmay23 Apr 23, 2021
e23cd48
L13, L14: Small typos
dmay23 Apr 26, 2021
f7e4322
PP13: Changed formatting
dmay23 Apr 26, 2021
d915a53
L15: Cleanup formatting, added reference
dmay23 Apr 26, 2021
def4eef
L15, PP15: Removing log-normal distribution for 2021
dmay23 Apr 26, 2021
982d946
L5: Small updates (for clarity)
dmay23 Apr 29, 2021
4996c3b
Small typo: Removed text about log-normal.
dmay23 May 3, 2021
273c2ec
L16: Formatting and objectives. Added references.
dmay23 May 3, 2021
3062702
L17 update:
dmay23 May 3, 2021
2b405e5
L17: Ugly commit associated with taking notebook from binder and suff…
dmay23 May 3, 2021
b651305
L15: update
dmay23 May 3, 2021
f4857e6
L16, 17, 18 PP: Updates
dmay23 May 3, 2021
dde7154
L17 from my binder.
dmay23 May 3, 2021
c24ea14
L18: Update (without output)
dmay23 May 3, 2021
63e93c1
L18: Headings (without output)
dmay23 May 3, 2021
8882391
L18: With output
dmay23 May 3, 2021
11fdba8
HW6: Textual updates
dmay23 May 3, 2021
c89ab57
L16, L17: Typos / formatting
dmay23 May 5, 2021
25ee02b
L16: Typo
dmay23 May 5, 2021
8c43fdd
L18 PP: Fixed formatting of list
dmay23 May 7, 2021
59a61da
L18: Typos. geoplots -> geoplot
dmay23 May 7, 2021
efc5363
L18: geopandas to GeoPandas were appropriate.
dmay23 May 7, 2021
fffd290
L18: Syntax correction for inferno.
dmay23 May 7, 2021
177ceed
PP19, PP20, PP21: Updates
dmay23 May 10, 2021
f014bd0
L19 updates
dmay23 May 10, 2021
9ccc1b6
L20 updates
dmay23 May 10, 2021
0644eb4
L21 updates
dmay23 May 10, 2021
043271c
HW7 updates
dmay23 May 10, 2021
c6cc318
L21: Fixed Cartopy deprecation warnings
dmay23 May 10, 2021
8804b6b
L20: Typo
dmay23 May 10, 2021
1e99ecc
L22: Updated style
dmay23 May 10, 2021
d1321ba
L23: Updated style
dmay23 May 10, 2021
dc912c0
L24: Updated style
dmay23 May 10, 2021
248d201
L22: Formatting
dmay23 May 12, 2021
f1ff13c
L19: deg -> rad
dmay23 May 12, 2021
0e9d099
L22: Note about seeding KMeans()
dmay23 May 12, 2021
1ef08c3
L25: Formatting
dmay23 May 12, 2021
16dd580
Add plotly to env
dmay23 May 12, 2021
ad0cd0e
L25: Output
dmay23 May 12, 2021
994ed75
L25: Few formatting changes
dmay23 May 12, 2021
117b492
L27: Reformat
dmay23 May 12, 2021
02dff11
L27: With output. Stripped out unused modules.
dmay23 May 12, 2021
8c22e9a
PP19: dec -> Dec, inc -> Inc to be consistent with the header
dmay23 May 12, 2021
7ecb03a
L20: Typo
dmay23 May 12, 2021
f2f6d9b
L19: Typos
dmay23 May 12, 2021
3146df4
L19: Clarify text
dmay23 May 12, 2021
accfbcf
L20: More c -> C for Cartesian
dmay23 May 12, 2021
8b2cedc
PP20: TYPO!
dmay23 May 12, 2021
15130fa
L20: Typo
dmay23 May 12, 2021
f74b64b
Assignment 6: Equation re-formatting
dmay23 May 12, 2021
0c8249a
L16: Spacing / python style
dmay23 May 12, 2021
4adc719
PP21: Typo: Wrong lecture number
dmay23 May 14, 2021
e97321a
L21: Typo. Backwards should both be to L20
dmay23 May 14, 2021
17ded33
L21: Gosh - yet another typo in the code comments
dmay23 May 14, 2021
711d2e1
L21: Formatting
dmay23 May 19, 2021
dfd46bd
PP 22, 23: Formatting
dmay23 May 19, 2021
fdccbd2
PP22: Formatting
dmay23 May 19, 2021
c85d15f
PP22: Formatting
dmay23 May 19, 2021
5f0034f
L12: Missing brackets in method name
dmay23 May 19, 2021
980fbcf
PP23: Code style
dmay23 May 19, 2021
52899fb
PP23: Typo. 7 files -> 6 files. Thanks Brandon Bourassa.
dmay23 May 19, 2021
ae5d2a6
HW8: Re-factor layout
dmay23 May 19, 2021
15d8842
rewrote Assignment 8 to reflect this week's material
bcych May 20, 2021
d459eff
HW8: Reformat.
dmay23 May 20, 2021
b455f6c
PP24: Updated format.
dmay23 May 21, 2021
998f08f
PP24: Formatting
dmay23 May 21, 2021
4aa6a15
HW8: Small formatting change.
dmay23 May 21, 2021
f784fe6
PP25: Formatting
dmay23 May 25, 2021
151cec3
Add tools for DEM analysis
dmay23 May 25, 2021
fb7efbf
Add dem_utils module
dmay23 May 25, 2021
10da32b
Update env to include netcdf4
dmay23 May 25, 2021
f5d9703
Moving content for L26 / L27 out or root and into supp
dmay23 May 25, 2021
db5cbd1
New PP26 for DEM analysis
dmay23 May 25, 2021
2653ab0
New L26
dmay23 May 25, 2021
696b1a6
Updated lecture summary
dmay23 May 25, 2021
16fb870
L28: Animations
dmay23 May 25, 2021
c644d53
L25: Re-worked ending which was confused as L17 was removed.
dmay23 May 26, 2021
b214c9b
L26: typo
dmay23 May 26, 2021
a8068d4
PP25: Typo
dmay23 May 26, 2021
a4aa6b2
L25: Typo
dmay23 May 26, 2021
2575208
dem utils:
dmay23 May 26, 2021
5dcd90a
PP26: Clarify "journey"
dmay23 May 26, 2021
f4d78f0
L25: Typo. Inconsistency between text and code cell about lat/lon bou…
dmay23 May 26, 2021
d4db3f1
PP25: Clarification and corrected spelling.
dmay23 May 26, 2021
58f9009
dem_utils:
dmay23 May 27, 2021
db3ee79
L27: New lecture - Diffusion + LEM
dmay23 May 27, 2021
daae589
L26: Missing "Learning objectives" title
dmay23 May 27, 2021
5908ee6
L27: Typos
dmay23 May 27, 2021
6eab01c
Datasets: Rocky topo
dmay23 May 27, 2021
c97717e
HW9: Updated to define questions associated with 3D plotting and topo…
dmay23 May 28, 2021
89cc567
Update TOC
dmay23 May 28, 2021
65cd139
Dataset: Add topo file for the Rocky's
dmay23 May 28, 2021
dc7222b
Removed accident commit
dmay23 May 28, 2021
f8b0f2d
Updated course info
dmay23 May 28, 2021
37595c3
QuickStart / CheatSheet
dmay23 Jun 2, 2021
c1e799c
Update SIO113_CourseInformation.md
hpc4geo Jun 4, 2021
4ea1009
Update SIO113_CourseInformation.md
hpc4geo Jun 4, 2021
8f024df
Changed example name.
dmay23 Mar 28, 2022
5fab008
Updated Syllabus
dmay23 Mar 28, 2022
dd5d647
Assessment clarified.
dmay23 Mar 28, 2022
fff10f0
Name and date changes
dmay23 Mar 28, 2022
beba653
Typo
dmay23 Mar 28, 2022
7b29802
Remove white space
dmay23 Mar 28, 2022
2f24c26
Set to open a classic notebook environment
dmay23 Mar 28, 2022
75e685a
Remove introducing global variables.
dmay23 Mar 28, 2022
98a0bd4
Typo in email address
dmay23 Mar 28, 2022
7ed9743
Date corrected
dmay23 Mar 28, 2022
54801a3
Remove date altogether
dmay23 Mar 28, 2022
632087b
Type in course info
dmay23 Apr 4, 2022
5080d18
Textual updates
dmay23 Apr 4, 2022
7fc95df
Clarify what we want in Q2.
dmay23 Apr 4, 2022
566d5d3
Remove word "nested". It is confusing.
dmay23 Apr 4, 2022
547c857
Typo
dmay23 Apr 8, 2022
33ef104
Formatting changes.
dmay23 Apr 11, 2022
1f19843
Add period.
dmay23 Apr 18, 2022
92a4f2d
Clarity improvement.
dmay23 Apr 18, 2022
b92b6f1
Improve question clarity for HW01
dmay23 Apr 18, 2022
533cb7f
Small text change.
dmay23 Apr 18, 2022
b87bd8c
TYPO: N -> Ne
dmay23 Apr 20, 2022
11e2edb
.loc() -> .loc[] as `doc` is not actually a function.
dmay23 Apr 25, 2022
43cd4a5
isosasty typo
dmay23 Apr 25, 2022
4b0ffcf
Refector to describe random.seed() at the end of the lecture. This wa…
dmay23 Apr 25, 2022
a23f5a9
Clarify where the distributions are discussed
dmay23 May 9, 2022
b48d3d0
Small edits to improve clarity of notation.
dmay23 May 16, 2022
e188dcd
Moving files around to make room for new PCA lecture
dmay23 May 16, 2022
2fd1374
Format change in section headings
dmay23 May 16, 2022
3468632
Added PCA lecture and Practice problem
dmay23 May 16, 2022
9d9c56d
Updated assignment 8 and 9 to include PCA content
dmay23 May 16, 2022
fa7979f
L24 updates (compression ratio, note about .gz files)
dmay23 May 16, 2022
79078fc
Updated course schedule and index
dmay23 May 16, 2022
e59e098
Typo in list defining the square for Q2
dmay23 May 18, 2022
2ba17a3
Updated names
dmay23 May 23, 2022
d34ab78
updated for spring 2023
hpc4geo Apr 3, 2023
6ba67b3
SIO113_CourseInformation.md
hpc4geo Apr 3, 2023
0a5da80
Changed style
hpc4geo Apr 3, 2023
a5e5b2b
Removed year, formatting for unit name
hpc4geo Apr 3, 2023
0adebbc
format of unit name
hpc4geo Apr 3, 2023
07aa400
removed stray code blocks
hpc4geo Apr 3, 2023
5722c6d
updated instruction for new interface
hpc4geo Apr 3, 2023
3ac7c2b
removed student email
hpc4geo Apr 3, 2023
73f75af
rename files
hpc4geo Apr 3, 2023
9543683
updated images to reflect new notebook style
hpc4geo Apr 3, 2023
89e6232
updated question for clarity
hpc4geo Apr 3, 2023
45fefe8
update rendered view
hpc4geo Apr 3, 2023
af1917e
updated and fixed formatting
hpc4geo Apr 3, 2023
2698f73
Clarified PP2
hpc4geo Apr 3, 2023
9926540
fixed typesetting in operation table to avoid rendering error on github
hpc4geo Apr 5, 2023
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Datasets/SurfaceTemp/tmp.csv
mknb
update_git
.ipynb_checkpoints/*
Practice_Problems/.ipynb_checkpoints/*
Assignments/.ipynb_checkpoints/*
Supplementary_Lectures/.ipynb_checkpoints/*
80 changes: 80 additions & 0 deletions Assignments/Assignment_1.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# SIO 113: Assignment #1\n",
"\n",
"#### Instructor: Dave May (dmay@ucsd.edu)\n",
"\n",
"#### Assistant: Gabrielle Hobson (ghobson@ucsd.edu)\n",
"\n",
"#### Scripps Institution of Oceanography, UCSD.\n",
"\n",
"----"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"- **Create** a new jupyter notebook (under File menu, select \"New Notebook\"). \n",
"- **Rename** your notebook (under File menu, select \"Rename\") using the format YourLastname_FirstInitial_HW_01.\n",
"- Save the notebook (click on the disk icon in the menu bar).\n",
"- Create a **markdown** block in which you will describe what the notebook does. \n",
"- Make a **code** block that creates a `list` called `planets`.\n",
" - Append all the planets to the list.\n",
" - Make a deep copy of your `planets` list (with a different name). \n",
" - Print the element at **index** 2 in your `planets` list. \n",
" - Set the element at **index** 2 in your copy to the value `'X'`.\n",
" - Print the element at **index** 2 in both lists (`planets` and your copy).\n",
" - Append the element that you just changed to the end of your copy.\n",
" - Use the `help()` function to find out what the _built-in_ function `len()` does.\n",
"- Create a **set** from `planets` and your copy of `planets`. Call these sets `planets_s` and `planets_copy_s`.\n",
" - Find the elements in common between the two planet sets (i.e. `planets_s` and `planets_copy_s`).\n",
"- Make another code block that creates a list called, e.g., `numList`, using `range()` that has 8 values starting with 1. \n",
" - Print out your new list.\n",
" - Create a **set** from your new list of numbers `numList`. Call this `numList_s` \n",
" - Find the elements in common between your `planets_s` set and your numbers `numList_s`. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-danger\"><b> \n",
"To receive full credit, your notebook:\n",
" \n",
"1. Must have the correct name;\n",
"2. Must be fully commented;\n",
"3. Must run as expected;\n",
"4. Must be submitted into Canvas before the deadline.\n",
"</b></div>"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.8.3"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
123 changes: 123 additions & 0 deletions Assignments/Assignment_2.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# SIO 113: Assignment #2\n",
"\n",
"#### Instructor: Dave May (dmay@ucsd.edu)\n",
"\n",
"#### Assistant: Gabrielle Hobson (ghobson@ucsd.edu)\n",
"\n",
"#### Scripps Institution of Oceanography, UCSD.\n",
"\n",
"----"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-info\"><b>Preliminary:</b>\n",
"Create a new notebook and rename it using the format YourLastname_FirstInitial_HW_02.\n",
"</div>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\"><b>Note:</b>\n",
"In the following it is assumed that you imported the NumPy module into the following namespace\n",
" \n",
"`\n",
"import numpy as np\n",
"` \n",
"</div>"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"- In a **markdown** cell, write a description of what the notebook does.\n",
"- Create a NumPy array of numbers from 0 to 100.\n",
"- Create another list that is empty.\n",
"- Write a `for` loop that takes the square root of each value in your NumPy `ndarray` (using `np.sqrt()`) and appends the result to the empty list. \n",
"- Print out all the numbers that are divisible by 4 (using the modulo operator).\n",
"- Plot the square roots against the original values in the NumPy array. \n",
"- Create a dictionary with at least four key:value pairs.\n",
"\n",
"- Write your own module that contains at least four functions and uses a dictionary and a list. Include a doc string in your module which briefly describes what functionality the module provides. Include a docstring for each function.\n",
"- Save the contents of your module in a file using the magic (Jupyter) command: \n",
"```python\n",
"%%writefile YOUR_MODULE_NAME.py\n",
"```\n",
"- Import your module into your notebook and call all of the functions defined within it. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\"><b>Hint:</b> For the purposes of debugging, you will probably want to 'reload' your module as you refine / change / edit it.\n",
"</div>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To reload your module, do the following (at the top of your notebook)\n",
"\n",
"```python\n",
"from importlib import reload\n",
"```\n",
"\n",
"and then\n",
"\n",
"```python\n",
"reload(YOUR_MODULE_NAME)\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-danger\"><b> \n",
"To receive full credit, your notebook:\n",
" \n",
"1. Must have the correct name;\n",
"2. Must be fully commented;\n",
"3. Must run as expected;\n",
"4. Must be submitted into Canvas before the deadline.\n",
"</b></div>"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.8.3"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
101 changes: 101 additions & 0 deletions Assignments/Assignment_3.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# SIO 113: Assignment #3\n",
"\n",
"#### Instructor: Dave May (dmay@ucsd.edu)\n",
"\n",
"#### Assistant: Gabrielle Hobson (ghobson@ucsd.edu)\n",
"\n",
"#### Scripps Institution of Oceanography, UCSD.\n",
"\n",
"----"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-info\"><b>Preliminary:</b>\n",
"Create a new notebook and rename it using the format YourLastname_FirstInitial_HW_03.\n",
"</div>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Earthquake Analysis"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"1. Obtain the data set\n",
" * Go to the [IRIS website](http://ds.iris.edu/ieb/index.html?format=text&nodata=404&starttime=1970-01-01&endtime=2025-01-01&minmag=0&maxmag=10&mindepth=0&maxdepth=900&orderby=time-desc&limit=1000&maxlat=89.18&minlat=-89.18&maxlon=180.00&minlon=-180.00&zm=1&mt=ter) (US's national earthquake database).\n",
" * Search for the last 10 earthquakes. To do this, on the right panel, set \"Maximum earthquakes\" to `10` and set \"Select earthquakes by\" to `Newest`. Then click \"Apply\".\n",
" * On the right panel, under \"Download as\" select `Excel`.\n",
" * Upload the `.csv` file (it's probably called `IEB_export.csv`) into you Jupyter environment (or copy to a directory on your computer with your notebook in it). \n",
"2. Process the data\n",
" * Load the `.csv` file into a **pandas** `DataFrame`.\n",
" * Extract the latitudes, longitudes and depths as a **NumPy** array. \n",
"3. Visualize the data\n",
" * Create an XY scatter plot with longitude on the X-axis and latitudes on the Y-axis. Use small red triangles as the symbols. \n",
" * Add a title to you plot.\n",
" * Label both the x and y axes.\n",
" * Save your figure as a `.png` file.\n",
"4. Extensions for future work\n",
" * Write a module that has a great circle function in it that returns a value for the distance rounded to the nearest decimal.\n",
" * Save your module in a `.py` file to be re-used later."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\"><b>Note:</b>\n",
"When submitting your homework to Canvas, you must include the datafile you downloaded along with your solution (Jupyter notebook). Please upload your submisson as a single zip file.\n",
"</div>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-danger\"><b> \n",
"To receive full credit, your notebook:\n",
" \n",
"1. Must have the correct name;\n",
"2. Must be fully commented;\n",
"3. Must run as expected;\n",
"4. Must be submitted into Canvas before the deadline.\n",
"</b></div>"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"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.8.3"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
Loading