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 29
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 Aug 31
Week 1
Book Draft: 2.2.2 Starting up Python, 2.2.3 First Python session   IPython Demo (notebook).  
Tue Sep 05
Week 2
Book Draft: 3.1-3.3   Lecture: Python types, Ipython demo (notebook), Today's notebook (zipfile) Python for Dummies: Chapters 8 & 9
Thu Sep 07
Week 2
    Lecture: More Python types  
Tue Sep 12
Week 3
Book Draft: 3.4-3.6, 4.1-4.7. Confirmation that you're Running python assignment Lecture Conditional constructions, Boolean results, loops, List comprehension, functions. Today's notebook, Python for Dummies: Chapters 10 & 11 (Optional)
Thu Sep 14
Week 3
  Python types assignment    
Tue Sep 19
Week 4
Book Draft: 4.1-4.7 Quiz on Python types Lecture If-then statements, Boolean results, loops, List comprehension, functions Functions assignment helper notebook. Today's notebook: programming basics (zipfile)., In class working sessions: scripts, accessing formatted information and formatting information, combining types, using loops Python for Dummies: Chapters 10 & 11 (Optional)
Thu Sep 21
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. In class working sessions: scripts, accessing formatted information and formatting information, combining types, using loops, using code blocks.  
Tue Sep 26
Week 5
Book Draft: 5.5-5.7 Functions, importing, namespaces. Steps in solving the sudoku problem. In class working sessions: scripts, accessing formatted information and formatting information, combining types, using loops, using code blocks. Python for Dummies: Chapters 13, 14, 18
Thu Sep 28
Week 5
  Quiz on loops and functions, Python types quiz solution. In class working sessions: scripts, accessing formatted information and formatting information, combining types, using loops, using code blocks.  
Tue Oct 03
Week 6
Book Draft: Arrays in numpy.   Intro to numpy: arrays, tables, splicing, arithmetic with arrays, arrays versus lists.  
Thu Oct 05
Week 6
    More numpy (HOML) Boolean arrays, Boolean indexing. Fancy Indexing. Other manipulations.  
Tue Oct 10
Week 7
  Numpy assignment, More numpy: Data arrays, Boolean indexing, creating subarrays.  
Thu Oct 12
Week 7
Book Draft: Chap. 7: Classification of text, Regression. Numpy assignment solution. Classification (HOML). Handson Machine-Learning with Scikit-Learn and TensorFlow: Chapter 3 (Optional)
Tue Oct 17
Week 8
Book Draft: Chap. 7: Classification tutorial. Numpy quiz (3rd quiz!) Midterm Study notebook, Midterm Study solutions.  
Thu Oct 19
Week 8
Book Draft: Chap. 7: Linear classifiers, SVM classification, Final project suggestions. Classification (HOML). SVM classification. Handson Machine-Learning with Scikit-Learn and TensorFlow: Chapters 3 and 5 (Optional)
Tue Oct 24
Week 9
  Midterm Midterm  
Thu Oct 26
Week 9
Book draft: Reading in and tokenizing text data.   Preparing data for Machine learning algorithms. (HOML) Handson Machine-lEarning with Scikit-Learn and TensorFlow: Chapter 2 (Optional)
Tue Oct 31
Week 10
    Jane Austen numpy assignment, Classifying movie reviews. Classifying insults. Support Vector Machines.  
Thu Nov 02
Week 10
Book Draft: Applying linear classifiers to text: Movie review example.   Classifying movie reviews with Naive Bayes..  
Tue Nov 07
Week 11
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).  
Thu Nov 09
Week 11
Book Draft: Intro to pandas and pandas data frames, Pandas tutorial.
  Tools: Pandas Intro (HOML). Pandas notebook I, Pandas notebook II (Note that pandas notbook II presupposes that pandas notebook I has already been downloaded.) Pivot tables and merges in Pandas, Census data example,  
Tue Nov 14
Week 12
  Regular Expressions assignment (see the regular expressions NB).    
Thu Nov 16
Week 12
Book Draft: Chap. 9: Social networks intro. Project suggestions. Social Networks lectures slides, and Using networkx notebook.  
Tue Nov 21
Week 13
    Useful network notebooks: Facebook notebook, Community discovery with a weighted graph. Gephi demo, Discussing final projects
Thu Nov 23
Week 13
H'day H'day H'day H'day
Tue Nov 28
Week 14
Book Draft: Visualization.   Normal distribution notebook, Boxplot notebook, Violin plots notebook.  
Thu Nov 30
Week 14
  One of Pandas, or Anna Karenina Assignment, Classifying insults, Color and color maps I: Parallel coordinates plots. Color and color maps II: Correlation heat maps.. Visualizing higher dimensional data with color.  
Tue Dec 05
Week 15
    Visualizations that tell a story (Using bokeh).  
Thu Dec 07
Week 15
    Geographic visualization. Kernel density estimates. Projections.  
Tue Dec 12
Week 16
    Dimensionality reduction with LSI slides, Dimensionality reduction with LSI notes, Python code for LSI example.Web crawling notebook. Experimenting with Twitter (IPython cookbook). NLTK Book ch. 3
Thu Dec 14
Week 16
     
Last class day
 
Tue Dec 19
Week 17
       
Thu Dec 21
Week 17
  Assignments: Final projects due: Th Dec 21    
Tue Dec 26
Week 18
       
Thu Dec 28
Week 18