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 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 notebook, Numpy broadcasting (notes/examples). Python Data Science HB (PDSHB): Chapter 2. Numpy. PDSHB Notebook Index.
Tue Oct 06   Functions assignment solution. In class Boolean notebook solutions.    
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 2020. Notebooks: Pivot tables and merges in Pandas, Census data example, Importing and loading files in Colab.  
Tue Oct 27 Book Draft: Introducing Regular Expressions, Reading in and tokenizing text data. Final project suggestions, Numpy assignment solution. Regular expressions notebook. VanDerPlas: Whirlwind Tour of Python: Chapter 15: Notebooks. NLTK Book ch. 3
Tue Nov 03 H'day H'day H'day H'day
Tue Nov 10 Book Draft: Chap. 7: Classification of text. Regression, Chap. 7: Linear classifiers, SVM classification, Applying linear classifiers to text: Movie review example. Pandas assignment due . notebooks: Regression. Linear Classifiers (SVMs). Iris data classification (sklearn). Classifying movie review (NLTK); precision, recall, etcetera. Sklearn/Insult classification. Python Data Science HB (PDSHB): Chapter 5. Machine learning. PDSHB Notebook Index.
Tue Nov 17 Book Draft: Chap. 9: Social networks intro, Gephi demo. Project suggestions revisited. Social Networks lectures slides, and New using networkx notebook, Centrality experiments, Assortativity notebook.  
Tue Nov 24 Book Draft: Chap. 7: Regression. Regression,   Matplotlib Intro, 03_Classification (HOML). Regression, Regression and classification. NLTK Book ch. 3
Tue Dec 01 Book Draft: Chap. 8: Visualization.   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 08   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). Final project due in one week! Plotting basics, Box and violin plots, color maps 1, color maps 2, Mandelbrot and others. Linear Mapping examples. Dimensionality reduction with LSI slides, Dimensionality reduction with LSI notes, Python code for LSI example,