Linguist 278: Programming for Linguists
InstructorChristopher Potts
MeetingsTue/Thu 3:15-4:45 pm Pacific
LocationOnline with Zoom
Discussion and exercisesEd forum
Submitting workCanvas
Hacking sessionsMon 4:00-5:00 pm and Tue 9:00-10:00 am Pacific


Plan Assignment Reading/Reference
Sep 21
  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 5]
  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 23
Sep 28
  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
Sep 30
Oct 5
  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 12]
  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 7
Oct 12
  1. In-class hackathon: Anagram finder
  2. Iterators and generators
  1. Assignment 3 [due Oct 19]
  1. Notes on yield
  2. iterators
  3. generators
Oct 14
Oct 19
  1. In-class hacking using the Ed platform
  1. Assignment 4 [due Oct 26]
Oct 21
Oct 26
  1. Introduction to regular expressions
  2. More on regular expressions
  1. Assignment 5 [due Nov 2]
  1. re
  2. Dataquest regular expression cheat sheet
Oct 28
Nov 2
  1. Using Jupyter notebooks
  2. Introduction to Pandas
    [HTML version]
  3. Pandas exercises
    [HTML version]
  1. Assignment 6 [due Nov 9]
  1. Lucy Li's Jupyter notebook tutorial
  2. Pandas documentation
Nov 4
Nov 9
  1. Hackathon (== Assignment 7)
  1. Assignment 7 [due Nov 16]
  1. Wonderful language resources from Victor Kuperman and colleagues
Nov 11
Nov 16
  1. Introduction to object-oriented programming in Python
    [HTML version]
  1. Assignment 8 [due Nov 30]
  1. Classes
Nov 18
Nov 23 Thanksgiving week; no classes
Nov 25
Nov 30
  1. Document formats [HTML version]
  2. subprocess [HTML version]
  1. All coursework must be submitted by December 7, 11:59 pm Pacific
  1. glob
  2. csv
  3. gzip
  4. json
  5. pickle
  6. zipfile
  7. textract
  8. PyMuPDF
  9. Beautiful Soup
  10. requests
Dec 2
  1. Exception handling
  2. Unit testing with pytest
  3. Sorting
  4. Overview of visualization libraries
  1. pytest
  2. Background on unit testing
  3. sorted
  4. matplotlib
  5. Pandas visualization
  6. seaborn

[Stanford F21 academic calendar]