Linguist 278: Programming for Linguists
MeetingsMW 10:30-11:20 am
LocationEcon 218
DiscussionEd forum
Submitting workCanvas
Hacking sessionsThu 4:00-6:00
Fri 2:00-3:30
in 460-110
InstructorChristopher Potts
Office hrsThu 4:00-6:00
Location460-116


Plan Assignment Reading/Reference
Sep 23
  1. The basics of numerical types and strings
  2. The basics of lists, built-ins, for-loops, conditionals, and function definitions
  1. Assignment 1 [due Oct 7]
  2. Chris's assignment 1 solutions
  1. str
  2. list
  3. Using Python as a calculator
  4. Numeric types
  5. Built-in functions
  6. Control flow tools
  7. Defining functions
Sep 25
Sep 30
  1. The basics of executing files, homework formatting, dicts, and tuples
  2. Review exercises and miscellaneous items
  1. tuple
  2. dict
  3. set
  4. sorted
  5. collections.defaultdict
Oct 2
Oct 7
  1. Range, advanced assignments, logical statements, printing, and function definitions
  2. Basic file and CSV reading and writing; os.path basics
  1. Assignment 2 [due Oct 14]
  2. Chris's assignment 2 solutions
  1. range, enumerate, and others
  2. More on defining functions
  3. Reading and writing files
  4. glob
  5. os
  6. shutil
  7. csv
  8. json
  9. gzip
  10. pickle
  11. Optional: shelve, yaml
Oct 9
Oct 14
  1. In-class hackathon: Anagram finder [in-class solution]
  2. Iterators and generators
  1. Assignment 3 [due Oct 21]
  2. Chris's assignment 3 solutions
  1. Notes on yield
  2. iterators
  3. generators
Oct 16
Oct 21
  1. Introduction to regular expressions
  1. Assignment 4 [due Oct 28]
  2. Chris's assignment 4 solutions
  1. re
  2. Dataquest regular expression cheat sheet
Oct 23
Oct 28
  1. Using Jupyter notebooks
  2. Introduction to Pandas
    [HTML version]
  3. Pandas exercises
    [HTML version]
  1. Assignment 5 [due Nov 4]
  2. HTML version for reference
  3. Chris's assignment 5 solutions [HTML version]
  4. Notes on final projects
  1. Lucy Li's Jupyter notebook tutorial
  2. Pandas documentation
Oct 30
Nov 4
  1. Exception handling
  2. Unit testing with pytest
  3. Documentation, subprocess, sorting, glob, json, and pickle
  1. Assignment 6 [due Nov 11]
  1. pytest
  2. Background on unit testing
  3. timeit
  4. sorted
  5. glob
  6. json
  7. pickle
Nov 6
Nov 11
  1. Introduction to object-oriented programming in Python
    [HTML version]
  2. Selected earlier homework problems as classes
  3. Tests for the selected earlier homework problems as classes
  1. Assignment 7 [due Nov 18]
  2. HTML version for reference
  1. Classes
Nov 13
Nov 18
  1. Hackathon (== Assignment 8)
  1. Assignment 8 [due Dec 2]
Nov 20
Thanksgiving recess
Dec 2
  1. Project work
  1. Final project [due Dec 9, 6:30 pm]
Dec 4

[Stanford F19 academic calendar]