Linguist 278: Programming for Linguists
MeetingsMW 1:30-2:50 pm
Location Sapp Center, Room 119
DiscussionCanvas site
InstructorChristopher Potts
Office hrsMW 10:00-11:00 am
Location460-116


Plan Assignment Reading/Reference
Sep 24
  1. The basics of numerical types, strings, and lists
  2. The basics of tuples, dicts, conditionals, for-loops, and function definitions
  1. Assignment 1 [due Oct 1]
  2. Chris's assignment 1 implementations
  1. str
  2. list
  3. tuple
  4. dict
  5. Using Python as a calculator
  6. Numeric types
  7. Built-in functions
  8. Control flow tools
  9. Defining functions
Sep 26
Oct 1
  1. Advanced assignments, logical statements, and function definitions; basic file reading and writing
  1. Assignment 2 [due Oct 8]
  2. Chris's assignment 2 implementations
  1. More on defining functions
  2. Reading and writing files
  3. set
  4. collections.defaultdict
  5. sorted
  6. range, enumerate, and others
Oct 3
Oct 8
  1. In-class hackathon: Anagram finder [Chris's implementation]
  2. Custom iterators
  1. Assignment 3 [due Oct 15]
  2. Chris's assignment 3 implementations
  1. Notes on yield
  2. iterators
  3. generators
Oct 10
Oct 15
  1. Reading and writing files of different formats
  1. Assignment 4 [due Oct 22]
  2. Chris's assignment 4 implementations
  1. glob
  2. os
  3. shutil
  4. csv
  5. json
  6. gzip
  7. pickle
  8. Optional: shelve, yaml
Oct 17
Oct 22
  1. Introduction to regular expressions
  1. Assignment 5 [due Oct 29]
  2. Chris's assignment 5 implementations
  3. Methods for finding the longest vowel sequence in a word list [HTML version]
  1. re
  2. Dataquest regular expression cheat sheet
  3. Mastering Regular Expressions §1
Oct 24
Oct 29
  1. Using Jupyter notebooks
  2. Introduction to Pandas
    [HTML version]
  3. In-class exercises
    [HTML version]
  4. Solutions to the in-class exercises [HTML version]
  1. Notes on final projects
  2. Assignment 6 [due Nov 5]
  3. HTML version (purely for reference)
  4. Chris's assignment 6 implementations
    [HTML verison]
  1. Pandas documentation
Oct 31
Nov 5
  1. CSV viewer command-line utility
  2. CSV viewer with Click
  3. Interactive annotation with Click
  4. Introduction to the subprocess library [HTML version]
  1. Assignment 7 [due Nov 12]
  2. HTML version
  3. Chris's assignment 7 implementations
    [HTML verison]
  1. The Click library
  2. subprocess
Nov 7
  1. Basic web scraping
    [HTML version]
  2. Solutions to the web scraping exercises [HTML version]
  1. The requests library
  2. The Beautiful Soup library
  3. Optional: Scrapy
Nov 12
  1. Hackathon (== Assignment 8)
  1. Assignment 8 [due Nov 26]
  2. HTML version
Nov 14
Thanksgiving recess
Nov 26
  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 9 [due Dec 5, 11:59 pm]
  2. Final project [due Dec 12, 6:30 pm]
  1. Classes
Nov 28
Dec 3
  1. Project work
Dec 5

[Stanford F18 academic calendar]