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 25 Book Draft: Table of Contents, 1. Preface, 2.1-2.3 What is this course about? What is Python? Why Python 2.4 Install Python (Anaconda) or run in the cloud? Assignment: Running Python Notebook. Introductory remarks Jupyter notebook Demo (notebook). Python Data Science HB (PDSHB): Chapter 1. IPython PDSHB Notebook Index. (Notebooks contain the text of PDSHB + executable text snippets)
Tue Sep 01 Book Draft: 3.1-3.3 Python types I, More Python types II. Running python assignment due. Notebook demo (notebook), Python types notebook, Python types I: Strings, numbers. Python types II: Sequences, Dictionaries, sets. VanDerPlas: Whirlwind Tour of Python: Chapter 7: Notebooks.
Tue Sep 08 Book Draft: If-then statements, Boolean results, loops, List comprehension, Assignment: Python types assignment due. Loops, conditional clauses notebook. VanDerPlas: Whirlwind Tour of Python: Chapter 8, 9, 12: Notebooks.
Tue Sep 15 Book Draft: 5.1: importing, 5.2 Namespaces, 5.3 block structure, 5.4 Functions and function parameters, import, namespaces, classes.   Notebooks: Functions.  
Tue Sep 22 Book Draft: Book Draft: 4.6 Functions. 4.7. Functions Functions assignment due. Notebooks: Functions. Sets, Set operations, Set example, Iterators and generators, Climate change problem (containers), DNA string (containers, coding), DNA translation(Dictionary codebook). VanDerPlas: Whirlwind Tour of Python: Chapter 9: Notebooks.
Tue Sep 29 Book Draft: Numpy: 6.1 - 6.4   Notebooks: Intro to numpy: arrays, tables, splicing, arithmetic with arrays, arrays versus lists, Boolean arrays and Boolean indexing, fancy indexing. More nitty gritty on Boolean arrays (from PDSHB), Numpy tools A broader survey of numpy capabilities (From Handson Machine Learning). In class Boolean ntebook. Python Data Science HB (PDSHB): Chapter 2. Numpy. PDSHB Notebook Index.
Tue Oct 06        
Tue Oct 13 Book Draft: Intro to pandas and pandas data frames 6.4 - 6.8., Pandas tutorial.
Numpy assignment due, Midterm Study notebook, Midterm Study answers. Lecture: Mid Semester Review. Tools: Pandas Intro (HOML). Pandas notebook I, Pandas notebook II Python Data Science HB (PDSHB): Chapter 3. Pandas. PDSHB Notebook Index.
Tue Oct 20   Midterm. (Midterm more study problems, Midterm more study problems.) Notebooks: Pivot tables and merges in Pandas, Census data example.  
Tue Oct 27 Book Draft: Introducing Regular Expressions, Reading in and tokenizing text data. Final project suggestions, Pandas assignment due . Regular expressions notebook. VanDerPlas: Whirlwind Tour of Python: Chapter 15: Notebooks. NLTK Book ch. 3
Tue Nov 03 Book Draft: Chap. 7: Classification of text. Regression, Chap. 7: Linear classifiers, SVM classification, Applying linear classifiers to text: Movie review example. Pandas quiz. Pandas quiz. Pandas assignment solution. Classifying insults. Support Vector Machines, Classifying movie reviews with Naive Bayes, Regression, Regression and classification. Python Data Science HB (PDSHB): Chapter 5. Machine learning. PDSHB Notebook Index.
Tue Nov 10 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.  
Tue Nov 17 Book Draft: Chap. 7: Regression. Regression,   Matplotlib Intro, 03_Classification (HOML). Regression, Regression and classification. NLTK Book ch. 3
Tue Nov 24 Book Draft: Chap. 8: Visualization. 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.  
Tue Dec 01   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,