Course Schedule

"This is an out of date page, don't use it for the current semester"

Part 1: Control Flow

Week 1

Mon: (Sep 05)
No class
  • Labor day
Wed: Introduction (Sep 07)
  • Class overview
  • Resources for getting help
Read: Syllabus
Link to slides
Python3 (Anaconda3) installation: Windows, MAC
Assigned: Lab-P1, P1
Fri: Pseudocode (Sep 09)
  • Flow of execution
  • State
Link to worksheet: pdf, docx
Link to worksheet solutions: Meena
Read: Python for Everybody, Ch. 1

Week 2

Mon: Operators (Sep 12)
  • Syntax, parsing, print
  • Values and types
  • Operator precedence
  • Boolean logic
  • Strings, escape charaters
  • Comments
Read: Downey Ch 1
Read: Python for Everybody, Ch. 2
Additional Reading: Computer terminology
Link to worksheet: pdf, docx
Link to worksheet solutions: Meena
Meena's Lecture: code
Wed: Vars and Exprs (Sep 14)
  • Naming rules
  • Assignment statements
  • Types of errors
Read: Downey Ch 2 and Appendix A
Read: Python for Everybody, Ch. 3
Due: P1
Meena's Lecture: code
Assigned: Lab-P2, P2
Fri: Using Functions (Sep 16)
  • Functions
  • Arguments, return values
  • input, print, type cast functions: int, float, str, bool
  • Importing modules
  • math Module
Read: Downey Ch 3 ("Function Calls" to "Composition")
Read: Python for Everybody, 5.1 - 5.4
Due: Student Information Survey
Due: Quiz1
Meena's Lecture: code

Week 3

Mon: Creating Functions (Sep 19)
  • Blocks
  • Positional arguments
  • Keyword arguments
  • default arguments
  • return
Read: Downey Ch 3 ("Adding New Functions" to "Flow of Execution" and "Fruitful and Void Functions")
Read: Python for Everybody, 5.5 - 5.10
Read: Creating Fruitful Functions
Link to worksheet: pdf, docx
Link to worksheet solutions: Meena
Interactive Exercises
Meena's Lecture: code
Wed: Function Scope (Sep 21)
  • Local vs. global
  • Argument passing
  • Frames
  • Stack diagrams
Read: Downey Ch 3 ("Parameters and Arguments" to end)
Read: Python for Everybody, 5.11 - 5.16
Due: P2
Link to slides
Interactive Exercises
Assigned: Lab-P3, P3
Fri: Conditionals 1 (Sep 23)
  • Boolean logic
  • if, elif, else
  • Blocks of code
Read: Downey Ch 5 ("Floor Division and Modulus" to "Nested Conditionals" and "Keyboard Input" to end) and Ch 6 ("Return Values" to "Boolean Functions")
Read: Python for Everybody, 4.1 - 4.5
Optional: Downey Ch 4
Due: Quiz2
Link to worksheet: pdf, docx
Interactive Exercises
Meena's Lecture: code

Week 4

Mon: Conditionals 2 (Sep 26)
  • Nesting
  • Refactoring
Read: Python for Everybody, 4.6 - end (skip 4.7)
Link to slides
Interactive Exercises
Meena's Lecture: code
Wed: Iteration 1 (Sep 28)
  • While Loop
  • Loop Control Variable
  • Infinite Iteration
  • for i in range
Read: Downey Ch 7
Read: Python for Everybody, 6.1 - 6.3
Due: P3
Link to slides
Meena's Lecture: code
Assigned: Lab-P4, P4
Fri: Iteration 2 (Sep 30)
  • Nested Loops
  • Break
  • Continue
Read: Python for Everybody, 6.4
Read (Optional): Sweigart Ch 2
Due: Quiz3
Link to slides
Link to worksheet: pdf, docx
Interactive Exercises
Meena's Lecture: code

Week 5

Mon: Iteration Practice (Oct 03)
  • for loops
  • Count, min, max, filtering
  • Nested loop tracing
Read: Python for Everybody, 6.5 - end
Link to worksheet: pdf
Meena's Lecture: code
Wed: Exam 1 review in lecture (Oct 05)
  • Regular exam: 5:45 to 7:15 pm
  • McBurney exam: 5:30 to 8:30 pm
Assigned: Lab-P5, P5
Fri: Strings (Oct 07)
  • Comparison
  • String methods
  • Strings are Sequences
  • Indexing & Slicing
  • For Loop, range()
Read: Downey Ch 8
Read: Python for Everybody, Ch. 7
Due: P4 (extension due to Gradescope issue)
Optional: Downey Ch 9
No quiz
Link to worksheet: pdf, docx
Meena's Lecture: code
Part 2: State

Week 6

Mon: Lists (Oct 10)
  • Lists are Sequences
  • Indexing & Slicing
  • Lists are Mutable
  • List Methods
Read: Downey Ch 10
Read: Python for Everybody, Ch. 9
Meena's Lecture: code
Wed: CSV Files (Oct 12)
  • Comparison to Spreadsheets
  • Format
  • Headers
  • Lists of lists
Read: Sweigart Ch 16 (through "Reading Data from Reader Objects in a for Loop")
Due: P5
Link to slides
Meena's Lecture: code
Assigned: Lab-P6, P6
Fri: List Practice (Oct 14)
  • Coding Demos
Due: Quiz4
Link to worksheet: pdf, docx
Meena's Lecture: code

Week 7

Mon: Dictionaries 1 (Oct 17)
  • Syntax
  • Lookup
  • Insert
  • Pop
Read: Downey Ch 11 ("A Dictionary is a Mapping" through "Looping and Dictionaries")
Read: Python for Everybody, 10.1 - 10.7
Link to slides
Interactive Exercises
Meena's Lecture: code
Wed: Dictionaries 2 (Oct 19)
  • Nesting
  • dict of lists
  • list of dicts
  • dict of dicts
Read: Downey Ch 11 ("Dictionaries and Lists" and "Global Variables" to end)
Due: P6
Meena's Lecture: code
Assigned: Lab-P7, P7
Fri: JSON (Oct 21)
  • Deserialization
  • Serialization
  • Python/JSON dfferences
Read: Sweigart Ch 16
Due: Quiz5
Link to slides
Link to worksheet: pdf, docx
Meena's Lecture: code

Week 8

Mon: Objects & Tuples (Oct 24)
  • Mutability
  • References
  • tuple
  • namedtuple
Read: Downey Ch 10 ("Objects and Values" and "Aliasing") and Ch 12
Read: Python for Everybody, 11.1 - 11.7
Link to slides
Interactive Exercises
Meena's Lecture: code
Wed: Copying (Oct 26)
  • References
  • Shallow Copy
  • Deep Copy
Read: Sweigart Ch 4 ("References" through the end)
Due: P7
Link to slides
Link to worksheet: pdf, docx
Link to worksheet solutions: Meena
Interactive Exercises
Meena's Lecture: code
Assigned: Lab-P8, P8
Fri: Recursive Functions (Oct 28)
  • Base/Recursive Cases
  • Lists of Lists
  • More Stack Diagrams
  • Stack Overflow
Read: Downey Ch 5 ("Recursion" through "Infinite Recursion"), Ch 6 ("More Recursion" through end)
Due: Quiz6
Link to slides
Interactive Exercises
Meena's Lecture: code

Week 9

Mon: Function References (Oct 31)
  • functions as objects
  • sort
  • lambda
Read: Python for Everybody, 10.8
Link to slides
Meena's Lecture: code
Wed: Comprehensions (Nov 02)
  • review sorting
  • list comprehensions
  • dict comprehensions
Read: Downey Ch 19.2, 12.3
Due: P8
Link to worksheet: pdf, docx
Link to worksheet solutions: pdf
Meena's Lecture: code
Assigned: Lab-P9, P9
Fri: Error Handling (Nov 04)
  • Assert Statements
  • Catching Exceptions
  • Throwing Exceptions
Read: Sweigart Ch 11 (beginning through "Assertions")
Due: Quiz7
Interactive Exercises
Link to worksheet: pdf, docx
Meena's Lecture: code

Week 10

Mon: Files and Directories (Nov 07)
  • Reading
  • Writing
  • os module
Read: Downey Ch 14
Link to slides
Meena's Lecture: code
Wed: Exam 2 review in lecture (Nov 09)
  • Regular exam: 5:45 to 7:15 pm
  • McBurney exam: 5:30 to 8:30 pm
Due: P9
Assigned: Lab-P10, P10
Fri: Pandas 1 (DS topic) (Nov 11)
  • Series
  • element-wise operations
  • mean, median, mode, quantiles
Required Reading: Pandas Intro Notebook (HTML or pandas-intro.ipynb)
No quiz
Meena's Lecture: code
Part 3: Data Science

Week 11

Mon: Pandas 2 (Nov 14)
  • DataFrame
  • reading CSVs
Link to worksheet: pdf, docx
Meena's Lecture: code
Wed: Web 1 (Nov 16)
  • requests module
  • get
  • status code
  • text files
  • json files
Read: Sweigart Ch 12
Due: P10
Due: CS319 Project part 1: proposal (Not applicable to CS220 students)
Meena's Lecture: code
Assigned: Lab-P11, P11
Fri: Web 2 (Nov 18)
  • Intro to HTML
  • Generating HTML list
  • Generating HTML hyperlink
  • Generating HTML table
Due: Quiz8
Meena's Lecture: code

Week 12

Mon: Web 3 (Nov 21)
  • Document Object Model
  • Parsing HTML
  • beautifulsoup
Meena's Lecture: code
Wed: Database 1 (Nov 23)
  • why use a database?
  • sqlite3 module
  • querying from Pandas
  • basic query structure
Due: P11
Due: CS319 Project part 2: data set (Not applicable to CS220 students)
Link to Slides
Meena's Lecture: code
Assigned: Lab-P12, P12
Fri: No class (Nov 25)
  • Thanksgiving break
No quiz

Week 13

Mon: Database 2 (Nov 28)
  • min, max, sum, avg
  • count, distinct
  • group by
  • having
Link to worksheet: notebook(s)
Meena's Lecture: code
Wed: Database 3 (Nov 30)
  • Worksheet
  • Pandas <--> SQL
Link to worksheet: pdf, docx
Link to worksheet solution (partial): pdf
Meena's Lecture: code
Fri: Advanced pandas topics (Dec 02)
  • np.NAN, isna, dropna, fillna
  • set_index
  • replace, apply
  • groupby
  • SQL vs pandas
Due: Quiz9
Meena's Lecture: code

Week 14

Mon: Plotting 1 (Dec 05)
  • bar plots
  • customizing plots
  • setting the index
  • making a bar for 'other'
Read: Matplotlib Intro (HTML or matplotlib-intro.ipynb and data)
Meena's Lecture: code
Wed: Plotting 2 (Dec 07)
  • scatter plots
  • correlation
Read: Line and Advanced Bar Plots (HTML, line-and-bar.ipynb and data)
Due: P12
Due: CS319 Project part 3: initial code (Not applicable to CS220 students)
Meena's Lecture: code
Assigned: Lab-P13, P13
Fri: Plotting 3 (Dec 09)
  • line plots
  • multiple line plots
  • multiple bar plots
Read: same as for "Plotting 2"
Due: Quiz10
Meena's Lecture: code

Week 15

Mon: Plotting 4 (Dec 12)
  • axes limits
  • logarithmic axes
  • subplots
  • adjacent plots
Read: Axes and Plot Design (HTML, axes.ipynb and data)
Meena's Lecture: code
Wed: Review/Catchup (Dec 14)
  • Bring Questions
Due: P13
Due: No work accepted after today. No late days or extensions may be used.
Due: CS319 Project part 4: final code (Not applicable to CS220 students)
Regular final exam: 12/19/2022 5:05 to 7:05 pm
McBurney final exam: 12/19/2022 4:30 to 8:30 pm