Note: this site is still up to serve as a reference for people who took the course in Fall of '19. If you're currently enrolled, please head to the site for the current semester.

Course Schedule

Part 1: Control Flow

Week 1

Mon: (Sep 2)
Labor Day!
No Class
Wed: Introduction (Sep 4)
  • Class Overview
  • Hardware
  • Software
  • Resources for getting help
Link to Slides
Read: Syllabus
Install: Python on Windows or Mac
Assigned: Lab-P1, P1
Fri: The Terminal (Sep 6)
  • Terminal Emulatation
  • Shells
  • Navigation
  • Program Execution
Link to Slides

Week 2

Mon: Pseudocode (Sep 9)
  • Flow of Execution
  • State
Link to Worksheet
No Slides
Wed: Programming (Sep 11)
  • Syntax+Parsing
  • Values+Types
  • Calculation+Operators
  • Boolean Logic
  • Interactive vs. Script Mode, print
Link to Slides
Link to Worksheet
Read: Downey Ch 1
Due: P1
Assigned: Lab-P2, P2
Lecture: code
Fri: Vars and Exprs (Sep 13)
  • Naming Rules
  • Assignment
  • Types of errors
  • Comments
Link to Slides
Read: Downey Ch 2
Lecture: code

Week 3

Mon: Using Functions (Sep 16)
  • Functions
  • input, str funcs, float funcs
  • Arguments, Return Values
  • Importing Modules
  • Math Module
Link to Slides
Read: Downey Ch 3 ("Function Calls" to "Composition")
Lecture: code
Wed: Creating Functions (Sep 18)
  • Positional Params
  • Keyword Params
  • Return Values
Read: Downey Ch 3 ("Adding New Functions" to "Flow of Execution" and "Fruitful and Void Functions")
Read: Creating Fruitful Functions
Link to Slides
Link to Worksheet
Interactive Exercises
Due: P2
Assigned: Lab-P3, P3
Lecture: code
Fri: Function Scope (Sep 20)
  • Local vs. Global
  • Argument Passing
  • Frames
  • Stack Diagrams
Read: Downey Ch 3 ("Parameters and Arguments" to end)
Link to Slides
Interactive Exercises

Week 4

Mon: Conditionals 1 (Sep 23)
  • Boolean Logic
  • if,elif,else
  • Modular arithmetic
Link to Slides
Link to Worksheet
Interactive Exercises
Read: Downey Ch 5 ("Floor Division and Modulus" to "Nested Conditionals" and "Keyboard Input" to end) and Ch 6 ("Return Values" to "Boolean Functions")
Optional: Downey Ch 4
Wed: Conditionals 2 (Sep 25)
  • Refactoring
  • Nesting
Link to Slides
Interactive Exercises
Due: P3
Assigned: Lab-P4, P4
Fri: Iteration 1 (Sep 27)
  • Reassignment
  • While Loop
  • Infinite Iteration
Link to Slides
Read: Downey Ch 7
Lecture: code
WATCH ONLINE

Week 5

Mon: Iteration 2 (Sep 30)
  • Break
  • Continue
Link to Slides
Link to Worksheet
Interactive Exercises
Read (Optional): Sweigart Ch 2
Lecture: code
Wed: Strings (Oct 2)
  • Indexing/Slicing
  • Sequences
  • For Loop, range()
  • Searching
  • Comparison
  • String formatting
Link to Slides
Link to Worksheet
Read: Downey Ch 8
Optional: Downey Ch 9
Due: P4
Assigned: Lab-P5, P5
Lecture: code
Fri: Review Day (Oct 4)
Evening Exam 1!
Part 2: State

Week 6

Mon: Lists (Oct 7)
  • Sequence, Like a String
  • Indexing, Slicing
  • sys.argv, dir()
  • Mutable vs. Immutable
  • List Methods
Link to Slides
Read: Downey Ch 10
Lecture: code
Wed: CSV Tables (Oct 9)
  • Comparison with Spreadsheets
  • Format
  • Headers
  • Lists of lists
Link to Slides
Read: Sweigart Ch 14 (through "Reading Data from Reader Objects in a for Loop")
Due: P5
Assigned: Lab-P6, P6
Lecture: code
Fri: List Practice (Oct 11)
  • Coding Demos
Link to Worksheet
Lecture: code (w/ Wed code)
No Slides

Week 7

Mon: Dictionaries 1 (Oct 14)
  • Syntax
  • Lookup
  • Insert
  • Pop
Link to Slides
Interactive Exercises
Read: Downey Ch 11 ("A Dictionary is a Mapping" through "Looping and Dictionaries")
Lecture: code
Wed: Dictionaries 2 (Oct 16)
  • Nesting
  • dicts with lists
  • defaultdict
Link to Slides
Interactive Exercises
Read: Downey Ch 11 ("Dictionaries and Lists" and "Global Variables" to end)
Due: P6
Assigned: Lab-P7, P7
Lecture: code
Fri: JSON (Oct 18)
  • Deserialization
  • Serialization
  • Pretty Printing
Link to Worksheet
Link to Slides
Read: Sweigart Ch 14
Lecture: code

Week 8

Mon: Objects (Oct 21)
  • namedtuple and recordclass
  • Mutability
  • References
  • Python Tutor
Link to Slides
Interactive Exercises
Read: Downey Ch 10 ("Objects and Values" and "Aliasing") and Ch 12
Wed: Copying (Oct 23)
  • References
  • Shallow Copy
  • Deep Copy
Link to Worksheet
Link to Slides
Interactive Exercises
Read: Sweigart Ch 4 ("References" through the end)
Due: P7
Assigned: Lab-P8a, P8
Fri: Recursive Functions (Oct 25)
  • Base/Resursive Cases
  • Lists of Lists
  • More Stack Diagrams
  • Stack Overflow
Link to Slides
Interactive Exercises
Read: Downey Ch 5 ("Recursion" through "Infinite Recursion"), Ch 6 ("More Recursion" through end) Lecture: code

Week 9

Mon: Function References (Oct 28)
  • map
  • sort
Link to Slides
Interactive Exercises
Lecture: code
Wed: Generator Functions (Oct 30)
  • iterators and generators
Assigned: Lab-P8b
Lecture: code
Fri: Error Handling (Nov 1)
  • Catching Exceptions
  • Throwing Exceptions
  • Asserts
Link to Slides
Interactive Exercises
Link to Worksheet
Read: Sweigart Ch 10 (beginning through "Assertions")
Lecture: code

Week 10

Mon: Files and Directories (Nov 4)
  • Reading
  • Writing
  • Listing children
Link to Slides
Read: Downey Ch 14 Lecture: code
Wed: Review Day (Nov 6)
Evening Exam 2!
Due: P8
Assigned: Lab-P9a, P9
Fri: Pandas 1 (Nov 8)
  • iPython
  • dataframe
  • series
  • reading CSVs
  • element-wise operations
Reading: Pandas Intro Notebook (HTML, .ipynb and data)
Lecture: code
Part 3: Data Science

Week 11

Mon: Pandas 2 (Nov 11)
  • practice
Link to Worksheet
Lecture: code
Wed: Web 1 (Nov 13)
  • Servers/Clients
  • URLs
  • HTTP: GET and POST
  • requests module
Link to Slides
Read: Sweigart Ch 11
Assigned: Lab-P9b Lecture: code
Fri: Web 2 (Nov 15)
  • Intro to HTML
  • Generating HTML
Link to Slides
Lecture: code

Week 12

Mon: Web 3 (Nov 18)
  • Document Object Model
  • Parsing HTML
  • beautifulsoup
Link to Slides
Lecture: code
Wed: Database 1 (Nov 20)
  • schemas/types
  • queries
  • where
  • SQLite
  • Querying from Pandas
Link to Slides
Due: P9
Assigned: Lab-P10a, P10
Lecture: code
Fri: Database 2 (Nov 22)
  • aggregates
  • group by
No Slides
Lecture: code (do lecture.ipynb in class, bus.ipynb at home)

Week 13

Mon: Plotting 1 (Nov 25)
  • bar+scatter plots
  • plot design
  • AxesSublot
Reading: Matplotlib Intro (HTML, .ipynb and data)
Lecture: code
Wed: Database 3 (Nov 27)
  • Worksheets
Link to Worksheet
Database 3 - Worksheet Answers
Fri: Thanksgiving!
(Nov 29)
No Class

Week 14

Mon: Plotting 2 (Dec 2)
  • line plots
Reading: Line and Advanced Bar Plots (HTML, .ipynb and data)
Lecture: code
Wed: Plotting 3 (Dec 4)
  • bar plots
Reading: same as for "Plotting 2"
Assigned: Lab-P10b
Lecture: code
Fri: Plotting 4 (Dec 6)
  • axes
  • adjacent plots
  • design decisions
Reading: Axes and Plot Design (HTML, .ipynb and data)
Lecture: code

Week 15

Mon: Randomness (Dec 9)
  • Debugging
  • Simulation
  • Significance
Link to Slides
Lecture: code
Wed: Review/Catchup (Dec 11)
  • Bring Questions
Link to Worksheet
Due: P10