Python for Social Science Syllabus

Course Outline

Linguistics 572

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






Thu Jan 20 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?   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 Jan 25 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.
Thu Jan 27        
Tue Feb 01 Book Draft: If-then statements, Boolean results, loops, List comprehension, Assignment: Python types assignment due. Loops, conditional clauses notebook. , Programming notebook. VanDerPlas: Whirlwind Tour of Python: Chapter 8, 9, 12: Notebooks.
Thu Feb 03        
Tue Feb 08 Book Draft: 5.1: importing, 5.2 Namespaces, 5.3 block structure, 5.4 Functions and function parameters, import, namespaces, classes. Solution to running python, Solution to python types. Notebooks: Functions, Programming, Harder programming.  
Thu Feb 10        
Tue Feb 15 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.
Thu Feb 17        
Tue Feb 22 Book Draft: Numpy: 6.1 - 6.4 Functions assignment solution. 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.
Thu Feb 24        
Tue Mar 01   In class Boolean notebook solutions. Notebooks: Edited version of numpy.ipynb suitable as a study tool.  
Thu Mar 03        
Tue Mar 08 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.
Thu Mar 10        
Tue Mar 15   Midterm 2022., This is when your midterm nb will be published! Numpy assignment solution. Notebooks: Pivot tables and merges in Pandas, Covid analysis example, Census data example, Importing and loading files in Colab.  
Thu Mar 17        
Tue Mar 22 Book Draft: Introducing Regular Expressions, Reading in and tokenizing text data. Final project suggestions, This is when your midterm will be due. Regular expressions notebook, WordNet, Unicode, Text processing notebook. VanDerPlas: Whirlwind Tour of Python: Chapter 15: Notebooks. NLTK Book ch. 3
Thu Mar 24        
Tue Mar 29 H'day H'day H'day H'day
Thu Mar 31 H'day H'day H'day H'day
Tue Apr 05 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.
Thu Apr 07        
Tue Apr 12 Book Draft: Chap. 9: Social networks intro, Gephi demo. Project suggestions revisited, Midterm answers for your midterm version (includes extensive annotations). Social Networks lectures slides, and New using networkx notebook, Centrality experiments, Assortativity notebook. Facebook ego networks.  
Thu Apr 14        
Tue Apr 19 Book Draft: Chap. 7: Regression. Regression, Classification assignment due. Matplotlib Intro, 03_Classification (HOML). Regression, Regression and classification. NLTK Book ch. 3
Thu Apr 21        
Tue Apr 26 Book Draft: Chap. 8: Visualization. Matplotlib exercises NB. Complete solution for pandas assignment. Notebooks: Review of plotting basics, Box and violin plots, Color: Visualizing multidimensional data: Parallel coordinate plots, Color: correlation heat maps, Geographic visualization, NY Times Covid analysis, geographic visualization. Mandelbrot and others. Linear Mapping examples.
Thu Apr 28        
Tue May 03   Matplotlib exercises NB. Matplotlib exercises NB with answers. Data bias.  
Thu May 05   Complete solution for classification assignment. Final project due 5/12  
Last class day