Python for Social Science Syllabus

Course Outline

Linguistics 572

The table below gives an approximate schedule of classes, assignments, and lectures for this course.

Day

Reading

Assignment

Lecture

Background

Tue Aug 30
Week 1
Book Draft: Table of Contents, 1. Preface, 2.1-2.2.1 Why Python? Installing Python   Introductory remarks Installing Python (Enthought) Python for Dummies: Chapters 6 & 7
Thu Sep 01
Week 1
Book Draft: 2.2.2 Starting up Python, 2.2.3 First Python session   IPython Demo (notebook).  
Tue Sep 06
Week 2
Book Draft: 3.1-3.3 Confirmation that you're Running python assignment Lecture: Python types, Ipython demo (notebook), Today's notebook (zipfile) Python for Dummies: Chapters 8 & 9
Thu Sep 08
Week 2
    Lecture: More Python types  
Tue Sep 13
Week 3
Book Draft: 3.4-3.6, 4.1-4.7. Python types assignment Lecture Conditional constructions, Boolean results, loops, List comprehension, functions. Today's notebook, Python for Dummies: Chapters 10 & 11
Thu Sep 15
Week 3
  Python types assignment solution    
Tue Sep 20
Week 4
Book Draft: 4.1-4.7 Quiz on Python types Lecture Conditional constructions, Boolean results, loops, List comprehension, functions Functions assignment helper notebook. Today's notebook: programming basics (zipfile). Python for Dummies: Chapters 10 & 11
Thu Sep 22
Week 4
Book Draft: 4.7. Functions 5.1: importing, 5.2 Namespaces, 5.3 block structure, 5.4 Functions and function parameters, Functions assignment. Guessing a number, Python types pitalls, control structure. In class programming exercises, namespaces.  
Tue Sep 27
Week 5
Book Draft: 5.5-5.7 Functions, importing, namespaces. Functions assignment solution, Steps in solving the sudoku problem. Today's notebook: programming basics (zipfile). Python for Dummies: Chapters 13, 14, 18
Thu Sep 29
Week 5
Book Draft: Arrays in numpy. Quiz on loops and functions. Intro to numpy: arrays, tables, splicing, arithmetic with arrays, arrays versus lists.  
Tue Oct 04
Week 6
    More numpy: Boolean arrays, Boolean indexing.  
Thu Oct 06
Week 6
  Numpy assignment, More numpy: Data arrays, Boolean indexing, creating subarrays.  
Tue Oct 11
Week 7
Book Draft: Chap. 7: Classification of text, Regression. Numpy assignment solutiion. Regression and classification. (brief intro), Regression.  
Thu Oct 13
Week 7
Book Draft: Chap. 7: Classification tutorial. Numpy quiz (3rd quiz!) Midterm Study notebook, Midterm Study solutions.  
Tue Oct 18
Week 8
  Book Draft: Chap. 7: Linear classifiers, SVM classification, Final project suggestions. SVM classification demo: the kernel trick, among others.  
Thu Oct 20
Week 8
  Midterm Midterm  
Tue Oct 25
Week 9
Book draft: Reading in and tokenizing text data.   File streams notebook,  
Thu Oct 27
Week 9
    Jane Austen numpy assignment. Classifying movie reviews. Classifying insults. Support Vector Machines.  
Tue Nov 01
Week 10
Book Draft: Applying linear classifiers to text: Movie review example.      
Thu Nov 03
Week 10
Book Draft: Introducing Regular Expressions. Regression and classification. Regular expressions notebook. (Note the regular expressions notebook and the regular expressions assignment below are the same).  
Tue Nov 08
Week 11
Book Draft: Intro to pandas and pandas data frames, Pandas tutorial.
  Pandas notebook I, Pandas notebook II (Note that pandas notbook II presupposes that pandas notebook I has already been downloaded.) Census data example.  
Thu Nov 10
Week 11
  Regular Expressions assignment (see the regular expressions NB).    
Tue Nov 15
Week 12
Book Draft: Chap. 9: Social networks intro. Project suggestions. Social Networks lectures slides, Using networkx notebook.  
Thu Nov 17
Week 12
    Insults with Naive Bayes. or Pandas assignment, or Facebook or Anna Karenina assignment.  
Tue Nov 22
Week 13
  One of insults, pandas, Facebook or AK assignment (see the associated NBs)   Gephi demo, Discussing final projects
Thu Nov 24
Week 13
H'day H'day H'day H'day
Tue Nov 29
Week 14
Book Draft: Visualization.   Jane Austen numpy assignment solution, Regular expressions notebook solution, Regression and classification solution, Normal distribution notebook, Boxplot notebook.  
Thu Dec 01
Week 14
    Color and color maps I: Parallel coordinates plots. Visualizing higher dimensional data with color.  
Tue Dec 06
Week 15
    Color and color maps II: Correlation heat maps..  
Thu Dec 08
Week 15
    Dimensionality reduction with LSI slides, Dimensionality reduction with LSI notes, Python code for LSI example.  
Tue Dec 13
Week 16
Book Draft: Web intro, Scraping web pages.   No Web crawling assignment, just a notebook.Web crawling notebook. Experimenting with Twitter (IPython cookbook).
Last class day
NLTK Book ch. 3
Thu Dec 15
Week 16
       
Tue Dec 20
Week 17
  Assignments: Final projects due: Tu Dec 20    
Thu Dec 22
Week 17
       
Tue Dec 27
Week 18
       
Thu Dec 29
Week 18