diff --git a/index.qmd b/index.qmd index 6e2aa42..aa21c77 100644 --- a/index.qmd +++ b/index.qmd @@ -10,7 +10,7 @@ The course is intended for researchers who want to continue learning the fundame - **Understand and distinguish** the use case of data structures to store different types of data. -- **Implement** code to Iterate over a collection (such as files, elements of a column, or a list of objects) to batch process each item. +- **Implement** code to iterate over a collection (such as files, elements of a column, or a list of objects) to batch process each item. - **Implement** code that has a branching structure depending on input data's condition. @@ -39,13 +39,13 @@ All classes are on Wednesdays from 12:00-1:30 PM PST either online, or in Arnold | Week | Date | Topic | |------|------|-------| -|1* | Jan 21 | Fundamentals | -|2 | Jan 28 | Iteration (for loops) | -|3* | Feb 4 | Conditionals | -|4 | Feb 11 | Functions | +|1* | Jan 21 | [Fundamentals](01-Fundamentals.qmd) | +|2 | Jan 28 | [Iteration (for loops)](02-Iteration.qmd) | +|3* | Feb 4 | [Conditionals](03-Conditionals.qmd) | +|4 | Feb 11 | [Functions](04-Functions.qmd) | |No Class | Feb 18 | Break week | -|5 | Feb 25 |Iteration Styles | -|6* | Mar 4 | Last Day of Class | +|5 | Feb 25 | [Iteration Styles](05-Iteration_Styles.qmd) | +|6* | Mar 4 | [Reference vs. Copy](06-Reference_vs_Copy.qmd) / Last Day of Class | * = Ted on Campus for class @@ -62,12 +62,19 @@ We will spend the first 20-25 minutes of each class on catching up on last week' ## First Class Survey -[First Class Survey](https://forms.gle/smj4wFAQufoHsG6h7) - Please fill out. We mostly want to see how confident you are before and after class. We will share these results with everyone (anonymized). +[First Class Survey](https://forms.gle/hGQLZ5AgS6Cs3aW57) - Please fill out. We mostly want to see how confident you are before and after class. We will share these results with everyone (anonymized). ## Weekly Check In -[Weekly Check In Form](https://forms.gle/obwC5GYAA3iPHk5x7) - please fill out to let us know if you have any issues or want to share what you've learned. We look at the answers in aggregate and we anonymize responses (unless you want us to know). +[Weekly Check In Form](https://forms.gle/SaVk8oH6ezWfKaHM7) - please fill out to let us know if you have any issues or want to share what you've learned. We look at the answers in aggregate and we anonymize responses (unless you want us to know). +## Weekly Cheatsheet + +I will be posting the recordings, solutions, and notes using the Weekly Cheatsheet. This link will be sent to you. + +## Google Classroom + +We will be using Google Classroom for exercises. Be sure to submit your exercises through there (it is the main mechanism for us to check them). ## Culture of the course @@ -105,4 +112,4 @@ Requirements: ## Offerings -This course is taught on a regular basis at [Fred Hutch Cancer Center](https://www.fredhutch.org/) through the [Data Science Lab](https://hutchdatascience.org/). Announcements of course offering can be found [here](https://hutchdatascience.org/training/). +This course is taught on a regular basis at [Fred Hutch Cancer Center](https://www.fredhutch.org/) through the [Data Science Lab](https://ocdo.fredhutch.org/dasl/). Announcements of course offering can be found [here](https://ocdo.fredhutch.org/dasl/courses/). diff --git a/slides/lesson1_slides.html b/slides/lesson1_slides.html index 7d5b1cd..07f0171 100644 --- a/slides/lesson1_slides.html +++ b/slides/lesson1_slides.html @@ -204,7 +204,7 @@

W1: Fundamentals

Welcome!

-

Please sign up for Google Classroom (link if you haven’t already.

+

Please sign up for Google Classroom (link) if you haven’t already.

Introductions

@@ -244,18 +244,63 @@

Goals of the course

A Motivating Example

https://colab.research.google.com/drive/1g2ylY3-s_jX2Yf2CGkIdApvgTP4vb0Dw?usp=sharing

-
-

Content of the course

-
    -
  1. Fundamentals and Dictionaries
  2. -
  3. Iteration
  4. -
  5. Functions
  6. -
  7. Iteration styles
  8. -
  9. Assignment and References
  10. -
  11. Mid-winter break! (for Seattle Public Schools)
  12. -
  13. Modules, Wrap-up, Pizza!
  14. -
  15. Optional: Data-a-thon Friday March 14, Learning Communities
  16. -
+
+

Tentative Schedule

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
WeekDateTopic
1*Jan 21Fundamentals
2Jan 28Iteration (for loops)
3*Feb 4Conditionals
4Feb 11Functions
No ClassFeb 18Break week
5Feb 25Iteration Styles
6*Mar 4Reference vs. Copy / Last Day of Class
+ +
+
+

More About the Schedule

+

All classes are on Wednesdays from 12:00-1:30 PM PST either online, or in Arnold M1-B406 (The Data Science Lounge). Connection details will be provided. Office hours related to each class day are posted below, and the invite will be sent to you.

+

In class we will be going through the notebooks hosted on Google Classroom.

+

Classes will be recorded, and those recordings will be sent to you after each class.

Full course page here: https://hutchdatascience.org/Intermediate_Python/

@@ -438,7 +483,7 @@

Break!

Dictionary

A dictionary is designed as a lookup table, organized in key-value pairs. You associate the key with a particular value, and use the key to find the value.

-
+
sentiment = {'happy': 8, 'sad': 2, 'joy': 7.5, 'embarrassed': 3.6, 'restless': 4.1, 'apathetic': 3.8, 'calm': 7}
 sentiment
@@ -454,7 +499,7 @@

Dictionary

You use a key to find its corresponding value:

-
+
sentiment['joy']
7.5
@@ -463,7 +508,7 @@

Dictionary

You cannot use a numerical index to find values, like you did for Lists!

-
+
#sentiment[0]
@@ -484,7 +529,7 @@

Rules of Dictionaries

-
+
duplicated_keys = {'Student' : 97, 'Student': 88, 'Student' : 91}
 duplicated_keys
@@ -493,12 +538,12 @@

Rules of Dictionaries

-
+
child = {"name" : "Emil", "year" : 2004, "likes": ["jumping", "skating", "laughing"]}
-
+
child["likes"][1]
'skating'
@@ -511,26 +556,26 @@

Rules of Dictionaries

Using key to find values

-
+
sentiment['joy'] 
7.5
-
+
sentiment['joy'] = sentiment['joy'] + 1

If a key doesn’t exist, you will get an error:

-
+
#sentiment["dog"]

If you don’t want to run the risk of getting an error, you can specify a default value using the .get() method.

-
+
sentiment.get("dog", "not found")
'not found'
@@ -538,7 +583,7 @@

Using key to find values

-
+
print(sentiment.get("dog"))
None
@@ -549,14 +594,14 @@

Using key to find values

Adding new key-value pairs

You can add more key-value pairs by defining it directly. If the key already exists, the mapping for that key will simply be updated.

-
+
sentiment['dog'] = 5

Application: Creating a Dataframe

You can create a Dataframe using a Dictionary. The key represent column names, and the value is a List containing the column’s values:

-
+
import pandas as pd
 
 simple_df = pd.DataFrame(data={'id': ["AAA", "BBB", "CCC", "DDD", "EEE"],
@@ -645,7 +690,7 @@ 

Application: Creating a Dataframe

Application: Data Recoding

You want to take “case_control” column of simple_df and change “case” to “experiment” and “control” to “baseline”.

This correspondence relationship can be stored in a dictionary via .replace() method for Series:

-
+
simple_df.case_control.replace({"case": "experiment", "control": "baseline"})
0    experiment
diff --git a/slides/lesson1_slides.qmd b/slides/lesson1_slides.qmd
index 08f3781..b461663 100644
--- a/slides/lesson1_slides.qmd
+++ b/slides/lesson1_slides.qmd
@@ -5,11 +5,12 @@ format:
     smaller: false
     scrollable: true
     echo: true
+    standalone: true
 ---
 
 ## Welcome!
 
-Please sign up for Google Classroom ([link](https://classroom.google.com/c/ODIzOTg2OTExNzU5?cjc=qfqni3j4) if you haven't already.
+Please sign up for Google Classroom ([link](https://classroom.google.com/c/ODIzOTg2OTExNzU5?cjc=qfqni3j4)) if you haven't already.
 
 ## Introductions
 
@@ -43,16 +44,30 @@ Please sign up for Google Classroom ([link](https://classroom.google.com/c/ODIzO
 
 [https://colab.research.google.com/drive/1g2ylY3-s_jX2Yf2CGkIdApvgTP4vb0Dw?usp=sharing](https://colab.research.google.com/drive/1g2ylY3-s_jX2Yf2CGkIdApvgTP4vb0Dw?usp=sharinghttps://colab.research.google.com/drive/1g2ylY3-s_jX2Yf2CGkIdApvgTP4vb0Dw?usp=sharing)
 
-## Content of the course
+## Tentative Schedule
+
+| Week | Date | Topic |
+|------|------|-------|
+|1* | Jan 21 | [Fundamentals](01-Fundamentals.qmd) |
+|2 | Jan 28 | [Iteration (for loops)](02-Iteration.qmd) |
+|3* | Feb 4 | [Conditionals](03-Conditionals.qmd) |
+|4 | Feb 11 | [Functions](04-Functions.qmd) |
+|No Class | Feb 18 | Break week |
+|5 | Feb 25 | [Iteration Styles](05-Iteration_Styles.qmd) |
+|6* | Mar 4 | [Reference vs. Copy](06-Reference_vs_Copy.qmd) / Last Day of Class |
+
+* = Ted on Campus for class
+
+
+## More About the Schedule
+
+All classes are on Wednesdays from 12:00-1:30 PM PST either online, or in Arnold M1-B406 (The Data Science Lounge). Connection details will be provided. Office hours related to each class day are posted below, and the invite will be sent to you.
+
+
+In class we will be going through the notebooks hosted on Google Classroom. 
+
+Classes will be recorded, and those recordings will be sent to you after each class.
 
-1.  Fundamentals and Dictionaries
-2.  Iteration
-3.  Functions
-4.  Iteration styles
-5.  Assignment and References
-6.  Mid-winter break! (for Seattle Public Schools)
-7.  Modules, Wrap-up, Pizza!
-8.  Optional: Data-a-thon Friday March 14, Learning Communities
 
 Full course page here: 
 
diff --git a/slides/lesson2_slides.html b/slides/lesson2_slides.html
index 8a12734..1b97069 100644
--- a/slides/lesson2_slides.html
+++ b/slides/lesson2_slides.html
@@ -6,9 +6,8 @@
 
 
 
-
-
-  
+
+  
 
   W2: Iteration
   
@@ -29,8 +28,9 @@
       vertical-align: middle;
     }
     /* CSS for syntax highlighting */
+    html { -webkit-text-size-adjust: 100%; }
     pre > code.sourceCode { white-space: pre; position: relative; }
-    pre > code.sourceCode > span { line-height: 1.25; }
+    pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
     pre > code.sourceCode > span:empty { height: 1.2em; }
     .sourceCode { overflow: visible; }
     code.sourceCode > span { color: inherit; text-decoration: inherit; }
@@ -41,7 +41,7 @@
     }
     @media print {
     pre > code.sourceCode { white-space: pre-wrap; }
-    pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; }
+    pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
     }
     pre.numberSource code
       { counter-reset: source-line 0; }
@@ -94,209 +94,11 @@
     code span.vs { color: #20794d; } /* VerbatimString */
     code span.wa { color: #5e5e5e; font-style: italic; } /* Warning */
   
-  
+  
   
   
   
   
-