Python for Social Science Syllabus

Course Outline

Linguistics 572

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






Tue Aug 27 Book Draft: Table of Contents, 1. Preface, 2.1-2.2.1 Why Python? Installing Python Installing Python (Anaconda) Running python assignment(Due Thurs. Sep 5) Introductory remarks Automate the Boring Stuff: Part 1: Chapters 1-5.
Thu Aug 29 Book Draft: 2.2.2 Starting up Python, 2.2.3 First Python session   Jupyter notebook Demo (notebook). Automate the Boring Stuff: Part 1: Chapters 1-5.
Tue Sep 03 Book Draft: 3.1-3.3 Running python assignment due, running_python assignment solution and discussion.    
Thu Sep 05        
Tue Sep 10 Book Draft: Python types, More Python types   Notebook demo (notebook), Today's notebook (zipfile) Automate the Boring Stuff: Part One: Chapters 4, 5, 6
Thu Sep 12        
Tue Sep 17 Book Draft: If-then statements, Boolean results, loops, List comprehension, Python types assignment due.   Automate the Boring Stuff: Chapters 2 and 3.
Thu Sep 19     Loops.  
Tue Sep 24 Book Draft: 4.6 Functions. Quiz on Python types. Python types discussion notebook. Python types solution notebook. Logic of Functions, Functions. Automate the Boring Stuff: Chapter 3
Thu Sep 26        
Tue Oct 01 Book Draft: 4.7. Functions 5.1: importing, 5.2 Namespaces, 5.3 block structure, 5.4 Functions and function parameters, import, namespaces, classes. Functions assignment due. Programming odds and ends: Data structures (combining types), double loops, code blocks. imports and namespaces, classes, Intro Python classes, Summary notebook programming topics. Automate the Boring Stuff: Chapter 2, 8
Thu Oct 03        
Tue Oct 08 Book Draft: Numpy: 6.1 - 6.4 Quiz on loops and functions and more Python types. Functions assignment answers. Intro to numpy: arrays, tables, splicing, arithmetic with arrays, arrays versus lists. More numpy (HOML) arrays, Indexing with Boolean arrays, Boolean indexing, fancy indexing, creating subarrays.  
Thu Oct 10        
Tue Oct 15 Book Draft: Intro to pandas and pandas data frames 6.4 - 6.8., Pandas tutorial.
Numpy assignment due, Midterm Study notebook, Midterm Study answers, Midterm more study problems, Midterm more study problems solution. 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,  
Thu Oct 17        
Tue Oct 22   Numpy quiz (3rd quiz!), Numpy assignment solution. Lecture: Review  
Thu Oct 24   Midterm (copy of old midterm)    
Tue Oct 29 Book Draft: Introducing Regular Expressions, Reading in and tokenizing text data. Final project suggestions, Pandas assignment due . Regular expressions notebook. Automate the Boring Stuff: Chapters 7
Thu Oct 31        
Tue Nov 05 Book Draft: Chap. 7: Classification of text. Chap. 7: Linear classifiers, SVM classification, Applying linear classifiers to text: Movie review example. Pandas quiz. Pandas assignment solution. Classifying insults. Support Vector Machines, Classifying movie reviews with Naive Bayes, Regression, Regression and classification. NLTK Book ch. 3
Thu Nov 07        
Tue Nov 12 Book Draft: Chap. 9: Social networks intro, Gephi demo. Project suggestions revisited. Social Networks lectures slides, and Using networkx notebook, Networkx graphs with mousable nodes (using javascript), community detection, Community detection with a weighted graph, Facebook notebook.  
Thu Nov 14        
Tue Nov 19 Book Draft: Chap. 7: Regression. Regression,   03_Classification (HOML). Regression, Regression and classification. NLTK Book ch. 3
Thu Nov 21        
Tue Nov 26   Either Regular expressions assignment or Anna Karenina Assignment or Classifying insults, or Regression and classification, or Census data example (Section 1.9 has an assignment). Color and color maps I: Parallel coordinates plots. Color and color maps II: Correlation heat maps.. Visualizing higher dimensional data with color, Boxplot notebook, Geographic visualization. Kernel density estimates. Projections.  
Thu Nov 28 H'day H'day H'day H'day
Tue Dec 03 Book Draft: Visualization.   Visualizations that tell a story (Using bokeh). Geographic visualization. Kernel density estimates. Projections.  
Thu Dec 05        
Tue Dec 10 Book Draft: Dimensionality reduction. Assignment solutions: Regular expressions, Anna Karenina, Regression and Classification, Census data. Dimensionality reduction with LSI slides, Dimensionality reduction with LSI notes, Python code for LSI example.  
Thu Dec 12        
Tue Dec 17   Assignments: Final projects due: Tu Dec 17