From 44c880ec724fbe03474b1e0af435308193bfa66e Mon Sep 17 00:00:00 2001 From: Chris Lo Date: Wed, 11 Sep 2024 15:41:27 -0700 Subject: [PATCH] slides for first day --- 01-intro-to-computing.Rmd | 32 +-- 03-data-wrangling1.Rmd | 2 +- slides/images/function_machine.png | Bin 0 -> 21758 bytes slides/lesson1_slides.html | 398 ++++++++++++++++------------- slides/lesson1_slides.qmd | 193 +++++++++----- 5 files changed, 369 insertions(+), 256 deletions(-) create mode 100644 slides/images/function_machine.png diff --git a/01-intro-to-computing.Rmd b/01-intro-to-computing.Rmd index 536cced..99cfee8 100644 --- a/01-intro-to-computing.Rmd +++ b/01-intro-to-computing.Rmd @@ -105,17 +105,6 @@ add(18, add(21, 65)) Remember that the Python language is supposed to help us understand what we are writing in code easily, lending to *readable* code. Therefore, it is sometimes useful to come up with operations that is easier to read. (Most functions in Python are stored in a collection of functions called **modules** that needs to be loaded. The `import` statement gives us permission to access the functions in the module "operator".) -### Data types - -Here are some common data types we will be using in this course. - -| Data type name | **Data type shorthand** | **Examples** | -|----------------|:-----------------------:|:-----------------------:| -| Integer | int | 2, 4 | -| Float | float | 3.5, -34.1009 | -| String | str | "hello", "234-234-8594" | -| Boolean | bool | True, False | - ### Function machine schema A nice way to summarize this first grammar structure is using the function machine schema, way back from algebra class: @@ -128,6 +117,17 @@ Here are some aspects of this schema to pay attention to: - A function can have different kinds of inputs and outputs - it doesn't need to be numbers. In the `len()` function, the input is a String, and the output is an Integer. We will see increasingly complex functions with all sorts of different inputs and outputs. +### Data types + +Here are some common data types we will be using in this course. + +| Data type name | **Data type shorthand** | **Examples** | +|----------------|:-----------------------:|:-----------------------:| +| Integer | int | 2, 4 | +| Float | float | 3.5, -34.1009 | +| String | str | "hello", "234-234-8594" | +| Boolean | bool | True, False | + ## Grammar Structure 2: Storing data types in the Variable Environment To build up a computer program, we need to store our returned data type from our expression somewhere for downstream use. We can assign a variable to it as follows: @@ -175,7 +175,7 @@ Let's look at functions a little bit more formally: A function has a **function > > The output of functions is called the **returned value**. -Often, we will use multiple functions in a nested way, and it is important to understand how the Python console understand the order of operation. We can also use paranthesis to change the order of operation. Think about what the Python is going to do step-by--step in the lines of code below: +Often, we will use multiple functions in a nested way, and it is important to understand how the Python console understand the order of operation. We can also use parenthesis to change the order of operation. Think about what the Python is going to do step-by--step in the lines of code below: ```{python} max(len("hello"), 4) @@ -221,11 +221,11 @@ And there is an operational equivalent: We will mostly look at functions with input arguments and return types in this course, but not all functions need to have input arguments and output return. Let's look at some examples of functions that don't always have an input or output: -| Function call | What it takes in | What it does | Returns | +| Function call | What it takes in | What it does | Returns | |----------------|----------------|-------------------------|----------------| -| [`pow(a, b)`](https://docs.python.org/3/library/functions.html#pow) | integer `a`, integer `b` | Raises `a` to the `b`th power. | Integer | -| [`print(x)`](https://docs.python.org/3/library/functions.html#print) | any data type `x` | Prints out the value of `x` to the console. | None | -| [`dir()`](https://docs.python.org/3/library/functions.html#dir) | Nothing | Gives a list of all the variables defined in the environment. | List | +| [`pow(a, b)`](https://docs.python.org/3/library/functions.html#pow) | integer `a`, integer `b` | Raises `a` to the `b`th power. | Integer | +| [`time.sleep(x)`](https://docs.python.org/3/library/time.html#time.sleep) | Integer `x` | Waits for `x` seconds. | None | +| [`dir()`](https://docs.python.org/3/library/functions.html#dir) | Nothing | Gives a list of all the variables defined in the environment. | List | ## Tips on writing your first code diff --git a/03-data-wrangling1.Rmd b/03-data-wrangling1.Rmd index eeac127..53dea24 100644 --- a/03-data-wrangling1.Rmd +++ b/03-data-wrangling1.Rmd @@ -169,7 +169,7 @@ metadata.OncotreeLineage.value_counts().plot(kind = "bar") plt.show() ``` -(The `plt.figure()` and `plt.show()` functions are used to render the plots on the website, but you don't need to use it for your exercises - yet. We will discuss this in more detail during our week of data visualization.) +(The `plt.figure()` and `plt.show()` functions are used to render the plots on the website, but you don't need to use it for your exercises. We will discuss this in more detail during our week of data visualization.) #### Chained function calls diff --git a/slides/images/function_machine.png b/slides/images/function_machine.png new file mode 100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Ed zb;ykAD4~Z(ve`Y|i@md+a+Kr3#kdkRtE}Y8(@w=03~jLWaaQM~5wTzr!yo9zI*8?0 z{sBlf403F+T*qt?E+?B6AaHj4?HP{zL}T$9=pOt7nNw>{=h;ZF#7zdnd*VgE%by85 z0yBs8=~9`(DYCmf>_6OWmIMXO9H-8}EDfEwT$ox_0;Lc|4B>6Zz^KBCFdO2+wFkH6 z&2)*F1J-tgt_sE zR_d6vTFU;)d})mTaVF@_)(N9nSoB|Tp2xmwWB+=M-+|PP$FALURKi)EFWQII`%~hx zos9HQ5YzAXUW(bt(J}zFX7Si6cpU)daDh{wAhlb~F&@by-Rv7IL~*^$Dzi%(5FMB*Vd(gU(^5d2F zlqwB|w->F6ts5*>uE0*R4Jo|Z5=p)+$u#pqc?fHsMG*VNzpTQR z#vtA~Z2V8p$;o9D=PB_b3G)nhLf;aO5!9|JR{5ZgD>G7{de$Xm2&ijfGaUf1An|Om z-O0XdY}wm&)PK9)Wn9b<@Xex39!D?Go4mrAe|BFkIOH8p5gKB7!$E_1*!9T$nF$F9 zXNN!;7xNDmfBk4xp-fo+Odx)odD|3Y!qCKLZpV9$G!s;4gYJZ(1<19j?0oBc4j`<6 zEp9Uplx2oA>RoBMzNz;(xS5eO))>~aLMcYzh literal 0 HcmV?d00001 diff --git a/slides/lesson1_slides.html b/slides/lesson1_slides.html index 31ee4e5..de68197 100644 --- a/slides/lesson1_slides.html +++ b/slides/lesson1_slides.html @@ -307,6 +307,7 @@ } .reveal .slide:not(.center) { height: 100%; + overflow-y: auto; } .reveal .slide.scrollable { overflow-y: auto; @@ -438,8 +439,8 @@

Goals of the course

-
-

Culture of the course

+
+

Culture of the course (1/3)

  • Challenge: We are learning on the job, but you already have a full-time job
  • @@ -455,54 +456,53 @@

    Culture of the course

  • You should understand the gist of the material with class time, but mastery takes practice and practice.
-
+
+
+

Culture of the course (2/3)

  • Challenge: We sometimes struggle with our data science in isolation, unaware that someone two doors down from us has gone through the same struggle.
-
    -
  • We learn and work better with our peers.
  • +
  • We learn and work better with our peers.
    -
  • You might make a new friend, or two. 😄
  • +
  • You might make a new friend, or two. 😄
-
+
+
+

Culture of the course (3/3)

    -
  • Challenge: We all have various personal goals and applications
  • +
  • Challenge: We all have various personal goals and applications.
-
    -
  • Curate content during open community sessions and office hours based on your inputs.
  • +
  • Curate content during open community sessions and office hours based on your inputs.
-
-

Format of the course

+
+

Code of Conduct

    -
  • 6 classes: April 17, 24, May 1, 8, 15, 22
  • +
  • Be considerate in speech and actions, and actively seek to acknowledge and respect the boundaries of other members.
    -
  • Streamed online, recordings will be available.
  • +
  • Be respectful - Disagreements happen, but do not require poor behavior or poor manners. If someone asks you to stop, then stop.
    -
  • 1-2 hour exercises after each session are strongly encouraged as they provide practice.

  • -
  • Optional time to work on exercises together on Fridays Noon - 1pm PT.

  • +
  • Refrain from demeaning, discriminatory, or harassing behavior and speech.
-
    -
  • Online discussion via Slack.
  • -
+

The full CoC can be found here.

@@ -522,20 +522,58 @@

Content of the course

    -
  1. Data wrangling 2
  2. +
  3. Community Session 1 (optional)
    -
  1. Data visualization
  2. +
  3. Data wrangling 2
    -
  1. Loading your own data in, celebratory lunch!!
  2. +
  3. Data visualization
  4. +
+
+
+
    +
  1. Community Session 2 (optional)
  2. +
+
+
+
    +
  1. Putting it together: preview for code-a-thon (Tuesday Nov. 12)
  2. +
+
+
+
    +
  1. Code-a-thon: Friday Nov. 22
+
+

Format of the course

+
+
    +
  • Streamed online, recordings will be available.
  • +
+
+
+
    +
  • 1-2 hour exercises after each session are encouraged for practice.
  • +
+
+
+
    +
  • Optional time to work on exercises together on Fridays 10am - 11am PT.
  • +
+
+
+
    +
  • Online discussion via Slack.
  • +
+
+

What is a computer program?

@@ -549,20 +587,23 @@

What is a computer program?

-

We will focus on English <-> Programming Code for R Interpreter in this class.

+

We will focus on English <-> Programming Code for Python Interpreter in this class.

Another way of putting it: How we organize ideas <-> Instructing a computer to do something.

-
-

Setting up Posit Cloud and trying out your first analysis!

-

What’s the connection between English <-> Programming Code for R Interpreter?

+
+

Setting up Google Classroom and Colab and trying out your first analysis!

+
    +
  • Google Classroom invitation link.

  • +
  • Classwork -> Week 1 Classwork -> Week 1 Classwork.ipynb

  • +

Break

A pre-course survey:

-

https://forms.gle/Hr59ZbAan1JTumCa7

+

https://forms.gle/zFZ3VB1QZ84Y8Uef6

Grammar Structure 1: Evaluation of Expressions

@@ -573,7 +614,7 @@

Grammar Structure 1: Evaluation of Expressions

    -
  • Operations and functions take in data types and return another data type.
  • +
  • Functions and operations take in data types, do something with them, and return another data type.
@@ -584,55 +625,55 @@

Grammar Structure 1: Evaluation of Expressions

Examples

-
-
18 + 21
+
+
18 + 21
-
-
-
[1] 39
+
+
+
39
-
-
max(18, 21)
+
+
max(18, 21)
-
-
-
[1] 21
+
+
+
21
-
-
max(18 + 21, 65)
+
+
max(18 + 21, 65)
-
-
-
[1] 65
+
+
+
65
-
-
18 + (21 + 65)
+
+
18 + (21 + 65)
-
-
-
[1] 104
+
+
+
104
-
-
nchar("ATCG")
+
+
len("ATCG")
-
-
-
[1] 4
+
+
+
4
-
-

Data types

+
+

Function machine from algebra class

+ +Function machine from algebra class.
    +
  • A programmer should not need to know how the function or operation is implemented in order to use it - this emphasizes abstraction and modular thinking.
  • +
+
    -
  • Numeric: 18, -21, 65, 1.25

  • -
  • Character: “ATCG”, “Whatever”, “948-293-0000”

  • -
  • Logical: TRUE, FALSE

  • +
  • A function can have different kinds of inputs and outputs - it doesn’t need to be numbers.
+
+
+
+

Data types

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Data type nameData type shorthandExamples
Integerint2, 4
Floatfloat3.5, -34.1009
Stringstr“hello”, “234-234-8594”
BooleanboolTrue, False

Grammar Structure 2: Storing data types in the environment

To build up a computer program, we need to store our returned data type from our expression somewhere for downstream use.

-
-
x = 18 + 21
+
+
x = 18 + 21
-
+
@@ -718,7 +786,6 @@

Grammar Structure 2: Storing data types in the environment

Evaluate the expression to the right of =.

Bind variable to the left of = to the resulting value.

The variable is stored in the environment.

-

<- is okay too!

@@ -741,22 +808,33 @@

Grammar Structure 2: Storing data types in the environment

Downstream

Look, now x can be reused downstream:

-
-
x - 2
+
+
x - 2
-
-
-
[1] 37
+
+
+
37
-
-
y = x * 2
+
+
y = x * 2
 y
-
-
-
[1] 78
+
+
+
78
+
+
+
+
+

What’s the data type of a variable?

+
+
type(y)
+
+
+
+
int
@@ -764,7 +842,6 @@

Downstream

Grammar Structure 3: Evaluation of Functions

A function has a function name, arguments, and returns a data type.

-
@@ -774,54 +851,75 @@

Grammar Structure 3: Evaluation of Functions

Execution rule for functions:

-

Evaluate the function by its arguments, and if the arguments contain expressions, evaluate those expressions first.

-

The output of functions is called the returned value.

+

A function’s input arguments, when there’s more than one, can be specified by:

+
    +
  • The order the input given: pow(2, 3) is different than pow(3, 2).

  • +
  • The name of the input argument: pow(base=2, exp=3).

  • +
+

If the arguments contain expressions, evaluate those expressions first!

+
+
+

Examples

+
+
pow(2, 3)
-
-
-
sqrt(nchar("hello"))
+
+
+
8
-
-
-
[1] 2.236068
+
+
pow(base=2, exp=3)
+
+
+
8
-
-
-
(nchar("hello") + 4) * 2
-
-
-
[1] 18
+
+
pow(exp=3, base=2)
+
+
+
8
-
-
-

A programming language has following features:

-
    -
  • Grammar structure to construct expressions
  • -
+
+
max(len("hello"), 4)
+
+
+
+
5
+
-
-
    -
  • Combining expressions to create more complex expressions
  • -
+
+
+

Learning a new function

+
    +
  1. Function documentation
  2. +
+
?pow
+
+pow(base, exp, mod=None)
+Equivalent to base**exp with 2 arguments or base**exp % mod with 3 arguments
+ 
+Some types, such as ints, are able to use a more efficient algorithm when
+invoked using the three argument form.
-
    -
  • Encapsulate complex expressions via functions to create modular and reusable tasks
  • -
+
    +
  1. Documents page of a Python Module
  2. +
+

Base Python documentation of pow

-
    -
  • Encapsulate complex data via data structures to allow efficient manipulation of data
  • -
+
    +
  1. Forums vetted by experts, such as SlackOverflow
  2. +
@@ -849,13 +947,9 @@

Tips on writing your first code

  • Ask for help!
-
-
-
-

That’s all!

-

Maybe see you Friday Noon - 1pm PT to practice together!

@@ -1069,44 +1163,6 @@

That’s all!

] }); - - -