Python for Social Science Syllabus

Course Outline

Linguistics 572

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






Wed Aug 26 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)
Wed Sep 02 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.
Wed Sep 09 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.
Wed Sep 16 Book Draft: 5.1: importing, 5.2 Namespaces, 5.3 block structure, 5.4 Functions and function parameters, import, namespaces, classes.   Notebooks: Functions.  
Wed Sep 23 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.
Wed Sep 30 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.
Wed Oct 07        
Wed Oct 14 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.
Wed Oct 21   Midterm. (Midterm more study problems, Midterm more study problems.) Notebooks: Pivot tables and merges in Pandas, Census data example.  
Wed Oct 28 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
Wed Nov 04 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.
Wed Nov 11 H'day H'day H'day H'day
Wed Nov 18 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.  
Wed Nov 25 H'day H'day H'day H'day
Wed Dec 02 Book Draft: Chap. 7: Regression. Regression,   Matplotlib Intro, 03_Classification (HOML). Regression, Regression and classification. NLTK Book ch. 3
Wed Dec 09 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.  
Wed Dec 16   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,