diff --git a/images/horst_community.png b/images/horst_community.png new file mode 100644 index 0000000..ebc6540 Binary files /dev/null and b/images/horst_community.png differ diff --git a/slides/images/horst_community.png b/slides/images/horst_community.png new file mode 100644 index 0000000..ebc6540 Binary files /dev/null and b/slides/images/horst_community.png differ diff --git a/slides/lesson1_slides.html b/slides/lesson1_slides.html index de68197..efcdfad 100644 --- a/slides/lesson1_slides.html +++ b/slides/lesson1_slides.html @@ -384,6 +384,8 @@ margin-right: 0; } + +
@@ -439,11 +441,11 @@

Goals of the course

-
-

Culture of the course (1/3)

+
+

Culture of the course

    -
  • Challenge: We are learning on the job, but you already have a full-time job
  • +
  • Challenge: We are learning a new language, but you already have a full-time job
@@ -451,14 +453,9 @@

Culture of the course (1/3)

  • Teach not for mastery, but teach for empowerment to learn effectively.
  • -
    -
      -
    • You should understand the gist of the material with class time, but mastery takes practice and practice.
    • -
    -
    -
    -

    Culture of the course (2/3)

    +
    +

    Culture of the course

    • Challenge: We sometimes struggle with our data science in isolation, unaware that someone two doors down from us has gone through the same struggle.
    @@ -469,93 +466,37 @@

    Culture of the course (2/3)

      -
    • You might make a new friend, or two. 😄
    • -
    -
    -
    -
    -

    Culture of the course (3/3)

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

    Code of Conduct

    -
    -
      -
    • Be considerate in speech and actions, and actively seek to acknowledge and respect the boundaries of other members.
    • -
    -
    -
    -
      -
    • Be respectful - Disagreements happen, but do not require poor behavior or poor manners. If someone asks you to stop, then stop.
    • +
    • Know that if you have a question, other people will have it.
      -
    • Refrain from demeaning, discriminatory, or harassing behavior and speech.
    • +
    • Asking questions is our way of taking care of others.
    -

    The full CoC can be found here.

    +

    We ask you to follow Participation Guidelines and Code of Conduct.

    Content of the course

      -
    1. Intro to Computing
    2. -
    -
    -
      -
    1. Data structures
    2. -
    -
    -
    -
      -
    1. Data wrangling 1
    2. +
    3. Intro to Computing

    4. +
    5. Data structures

    6. +
    7. Data wrangling 1

    8. +
    9. Community Session 1 (optional)

    10. +
    11. Data wrangling 2

    12. +
    13. Data visualization

    14. +
    15. Community Session 2 (optional)

    16. +
    17. Putting it together: preview for code-a-thon (Tuesday Nov. 12)

    18. +
    19. Code-a-thon: Friday Nov. 22

    -
    -
    -
      -
    1. Community Session 1 (optional)
    2. -
    -
    -
    -
      -
    1. Data wrangling 2
    2. -
    -
    -
    -
      -
    1. Data visualization
    2. -
    -
    -
    -
      -
    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
    2. -
    -

    Format of the course

      -
    • Streamed online, recordings will be available.
    • +
    • Hybrid, and recordings will be available.
    @@ -565,7 +506,7 @@

    Format of the course

      -
    • Optional time to work on exercises together on Fridays 10am - 11am PT.
    • +
    • Office Hours Fridays 10am - 11am PT.
    @@ -574,24 +515,25 @@

    Format of the course

    +
    +

    Ready?

    + +

    What is a computer program?

      -
    • A sequence of instructions to manipulate data for the computer to execute.
    • +
    • A sequence of instructions to manipulate data for the computer to execute.
      -
    • A series of translations: English <-> Programming Code for Interpreter <-> Machine Code for Central Processing Unit (CPU)
    • +
    • A series of translations: English <-> Programming Code for Interpreter <-> Machine Code

    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 Google Classroom and Colab and trying out your first analysis!

    @@ -607,9 +549,18 @@

    Break

    Grammar Structure 1: Evaluation of Expressions

    +

    Consider the expression:

    +
    +
    min(2, 10)
    +
    +
    +
    +
    2
    +
    +
      -
    • Expressions are built out of operations or functions.
    • +
    • Expressions are built out of functions or operations.
    @@ -619,56 +570,56 @@

    Grammar Structure 1: Evaluation of Expressions

      -
    • We can combine multiple expressions together to form more complex expressions: an expression can have other expressions nested inside it.
    • +
    • If the function or operation input contains expressions, evaluate those expressions first.

    Examples

    -
    -
    18 + 21
    -
    -
    -
    -
    39
    -
    -
    -
    -
    max(18, 21)
    +
    18 + 21
    -
    21
    -
    +
    39
    -
    max(18 + 21, 65)
    +
    max(18, 21)
    -
    65
    +
    21
    -
    18 + (21 + 65)
    +
    max(18 + 21, 65)
    -
    104
    +
    65
    -
    len("ATCG")
    +
    18 + (21 + 65)
    +
    104
    +
    +
    +
    +
    +
    +
    len("ATCG")
    +
    +
    +
    4
    @@ -694,23 +645,23 @@

    Function machine from algebra class

    Operations are just functions. We could have written:

    -
    -
    from operator import add
    -
    -add(18, 21)
    +
    +
    from operator import add
    +
    +add(18, 21)
    -
    -
    +
    +
    39
    -
    -
    add(18, add(21, 65))
    +
    +
    add(18, add(21, 65))
    -
    -
    +
    +
    104
    @@ -720,7 +671,7 @@

    Function machine from algebra class

    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.
    • +
    • A programmer should not need to know how the function or operation is implemented in order to use it.
      @@ -766,10 +717,10 @@

      Data types

      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
      +
      +
      age = 18 + 21
      -
      +
      @@ -807,119 +758,146 @@

      Grammar Structure 2: Storing data types in the environment

    Downstream

    -

    Look, now x can be reused downstream:

    -
    -
    x - 2
    -
    -
    -
    -
    37
    -
    -
    -
    +

    Look, now age can be reused downstream:

    -
    y = x * 2
    -y
    +
    age - 2
    -
    78
    -
    +
    37
    -

    What’s the data type of a variable?

    -
    type(y)
    +
    age_double = age * 2
    +age_double
    -
    int
    -
    -
    -
    -
    -
    -

    Grammar Structure 3: Evaluation of Functions

    -

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

    -
    -
    -
    -
    - -
    -

    Execution rule for functions:

    -
    -
    -

    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!

    +
    78
    -
    -
    -

    Examples

    +
    +

    What’s the data type of a variable?

    -
    pow(2, 3)
    +
    type(age_double)
    -
    8
    +
    int
    +
    +
    +
    +

    More examples

    +
      +
    • max(a, b, ...) takes in at least two Integer or Float input arguments, and returns the highest value. You can give it more than two input arguments.

    • +
    • pow(base, exp) takes in two Integer input arguments, and returns the base raised to the exp power.

    • +
    • dir() takes in no input arguments, and returns all the variables in the environment as a list.

    • +
    +
    -
    pow(base=2, exp=3)
    +
    max(len("hello"), pow(2, 3), 20)
    -
    8
    +
    20
    +
    +
    -
    pow(exp=3, base=2)
    +
    age = 35
    +score = max(age, pow(2, 3), 20)
    +dir()
    -
    8
    +
    ['In',
    + 'Out',
    + '_',
    + '_1',
    + '_10',
    + '_11',
    + '_12',
    + '_13',
    + '_2',
    + '_3',
    + '_4',
    + '_5',
    + '_6',
    + '_7',
    + '_8',
    + '__',
    + '___',
    + '__builtin__',
    + '__builtins__',
    + '__name__',
    + '_dh',
    + '_i',
    + '_i1',
    + '_i10',
    + '_i11',
    + '_i12',
    + '_i13',
    + '_i14',
    + '_i2',
    + '_i3',
    + '_i4',
    + '_i5',
    + '_i6',
    + '_i7',
    + '_i8',
    + '_i9',
    + '_ih',
    + '_ii',
    + '_iii',
    + '_oh',
    + 'add',
    + 'age',
    + 'age_double',
    + 'exit',
    + 'get_ipython',
    + 'ojs_define',
    + 'open',
    + 'quit',
    + 'score']
    -
    +
    +
    +
    +

    Lists

    +

    List is a data structure that stores many elements of various data type, and the order its elements are stored matters. Each element of a List contains a single data type, or single data structure.

    +

    You can create a List via the bracket `[ ]` operator:

    -
    max(len("hello"), 4)
    +
    chrs = [2, 3, 2, 1, 2]
    -
    -
    5
    +
    +
    +

    Then, you can access the elements of a list via its “index number”, starting at 0.

    +
    +
    chrs[0]
    +
    +
    +
    +
    2
    -
    -
    -

    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.
    -
    -
      -
    1. Documents page of a Python Module
    2. -
    -

    Base Python documentation of pow

    -
      -
    1. Forums vetted by experts, such as SlackOverflow
    2. -
    +
    +
    chrs[1]
    +
    +
    +
    +
    3
    +
    +
    @@ -940,7 +918,7 @@

    Tips on writing your first code

      -
    • Live environments are great for testing, but not great for reproducibility.
    • +
    • The sequence of instructions you give matters!
    @@ -1163,6 +1141,17 @@

    Tips on writing your first code

    ] }); + +