Month: August 2023

Module 02: Numpy & Pandas

  1. Prepare (due Mon 9/4)
    1. Content below
    2. Canvas quiz
  2. Peer Instructions – See on the class forum
  3. Homework (due Sun 9/10) [Link]
  4. Worked Example [Link]

Content (Slides in the Box folder)

2.A – Numpy (1 hour)

  1. Why Numpy (8 min.)
  2. Numpy Array Basics (15 min.)
  3. Numpy Universal Functions (20 min.)
  4. Numpy Axis (14 min.)

2.B – Pandas (45 min.)

  1. Why Pandas (7 min.)
  2. Pandas Series (19 min.)
  3. Pandas Dataframe (21 min.)

Optional Supplements

Module 01: Python, Central tendency, & Jupyter Notebook

  1. Prepare (due Mon 8/28)
  2. Peer Instructions – See on the class forum
  3. Homework (due Sun 9/3, 11:59 PM, late due Su 9/10, no late tokens required) [Link]

Content (Slides in the Box folder)

1.A – Welcome to the class! (in-class on 8/30 or see recording)

1.B – Python3 (14 min.)

  1. Python vs. Java (3 min.)
  2. Data Types (2 min.)
  3. Iteration, Functions, Classes (7 min.) – slide 19 has a typo, the pdf has been fixed
  4. sorted() function documentation (2 min.)

1.C – Python for Data Science

  1. Anaconda and Jupyter (10 min.)
  2. Jupyter Notebook Demo (11 min.)

1.D – Central Tendency

  1. If you need a refresher/overview on the definitions of central tendency: mean, median, and mode

Optional Supplements

Restart and Run All

Here is a guide on how to submit properly formatted .ipynb files for homework and exams.

This is important because a common way to detect bugs that the autograder might find is to first restart the kernel and run everything. Moreover, it is the equivalent of ensuring that you are submitting a polished notebook.

Steps to restart the kernel and run all

Go to the button labeled “Kernel” at the top of the page.

Click on the “Kernel” button to open this dropdown menu. Now click “Restart & Run All.”

This box will then appear. Click the red button labeled “Restart and Run All Cells.”

How to confirm it is correctly formatted

After following the steps above, your notebook cells’ “In [#] ” labels will be in numerical order. Make sure to confirm that all code cells are run. This is a properly formatted .ipynb file. 

 

Example of an incorrectly formatted notebook

Although this .ipynb file below is in numerical order, the first cell in the file does not start with “In [1]” and is deemed an improperly formatted .ipynb file. 

Powered by WordPress & Theme by Anders Norén