Course Schedule#

The course will meet on Monday and Wednesday from 3:30 to 5:20 PM EST.

Here is the current week-by-week schedule đź“… . We may adjust as we go along.

To get started, let’s create the course schedule using the pandas module in Python. Click “show” to see the underlying code!

# import modules
import pandas as pd
import re
import numpy as np


# tell python to display output and print multiple objects
from IPython.display import display, HTML
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"

# create range b/t start and end date of course
start_date = pd.to_datetime("2023-01-04")
end_date = pd.to_datetime("2023-03-07")
st_alldates = pd.date_range(start_date, end_date)

# subset to days in that range equal to Monday or Wednesday or make-up class for MLK day
st_alldates = st_alldates[~st_alldates.isin(['2023-01-16'])] # remove MLK holiday
st_mw = st_alldates[st_alldates.day_name().isin(['Monday', 'Wednesday']) | st_alldates.isin(['2023-01-17'])]

# create DataFrame with that information
st_dates = [re.sub("2023\\-", "", str(day.date())) for day in st_mw] 
course_sched = pd.DataFrame({'dow': st_mw.day_name(),
                             'date': st_dates})
course_sched['day_date'] = course_sched.dow.astype(str) + " " + \
            course_sched.date.astype(str) 

# display the resulting date sequence
display(course_sched.day_date)
0     Wednesday 01-04
1        Monday 01-09
2     Wednesday 01-11
3       Tuesday 01-17
4     Wednesday 01-18
5        Monday 01-23
6     Wednesday 01-25
7        Monday 01-30
8     Wednesday 02-01
9        Monday 02-06
10    Wednesday 02-08
11       Monday 02-13
12    Wednesday 02-15
13       Monday 02-20
14    Wednesday 02-22
15       Monday 02-27
16    Wednesday 03-01
17       Monday 03-06
Name: day_date, dtype: object

The next few blocks of code creates the actual schedule content by joining the above list of dates with course concepts.

# create basic schedule content

# list of concepts
concepts = ["Course intro. & syllabus review (asynchronous)",
            "Python basics (variables, lists, arrays) & software setup",
            "Pandas for data manipulation 1 + static data visualization",
            "Pandas 2 (wrap-up)",
            "User-defined functions",
            "Workflow basics: command line & Github",
            "Reshaping data",
            "Catchup: Merging data & LaTeX",
            "Regular expressions (Regex)",
            "Text-as-data 1 (text mining)",
            "Text-as-data 2 (topic modeling)",
            "APIs 1 (NAEP & Yelp)",
            "APIs 2 (Twitter)",
            "Supervised machine learning 1 (logit & regularization)",
            "Supervised machine learning 2 (Trees & optimization)",
            "SQL",
            "Final project work session",
            "Final presentations"]

# check that concepts match number of weeks
assert len(course_sched.day_date) == len(concepts)

# combine dates with concepts
course_sched_concepts = pd.DataFrame({'Date': course_sched.day_date,
                                     'Concepts': concepts})

df = course_sched_concepts.copy()

print(df)
               Date                                           Concepts
0   Wednesday 01-04     Course intro. & syllabus review (asynchronous)
1      Monday 01-09  Python basics (variables, lists, arrays) & sof...
2   Wednesday 01-11  Pandas for data manipulation 1 + static data v...
3     Tuesday 01-17                                 Pandas 2 (wrap-up)
4   Wednesday 01-18                             User-defined functions
5      Monday 01-23             Workflow basics: command line & Github
6   Wednesday 01-25                                     Reshaping data
7      Monday 01-30                      Catchup: Merging data & LaTeX
8   Wednesday 02-01                        Regular expressions (Regex)
9      Monday 02-06                       Text-as-data 1 (text mining)
10  Wednesday 02-08                    Text-as-data 2 (topic modeling)
11     Monday 02-13                               APIs 1 (NAEP & Yelp)
12  Wednesday 02-15                                   APIs 2 (Twitter)
13     Monday 02-20  Supervised machine learning 1 (logit & regular...
14  Wednesday 02-22  Supervised machine learning 2 (Trees & optimiz...
15     Monday 02-27                                                SQL
16  Wednesday 03-01                         Final project work session
17     Monday 03-06                                Final presentations
# add DataCamp modules to schedule, matching to concepts conditionally
match_col = "Concepts" # concepts column to match on

tomatch = [df[match_col] == "Python basics (variables, lists, arrays) & software setup",
           df[match_col] == "Workflow basics: command line & Github",
           df[match_col] == "Pandas for data manipulation 1 + static data visualization",
           df[match_col] == "User-defined functions & LaTeX",
           df[match_col] == "Catchup: Merging data & LaTeX",
           df[match_col] == "Regular expressions (Regex)",
           df[match_col] == "Text-as-data 1 (text mining)",
           df[match_col] == "APIs 1 (NAEP & Yelp)",
           df[match_col] == "APIs 2 (Twitter)",
           df[match_col] == "Supervised machine learning 1 (logit & regularization)",
           df[match_col] == "SQL",
           df[match_col] == "Web-scraping"]

# define DataCamp modules
modules = ["Intro. to Python (chpts. 2-3)",
           "Intro. to Shell, Intro. to GitHub (chpts.)",
           "Data Manipulation with pandas (course)",
           "Writing your own functions (chpt.)",
           "Joining Data with pandas (chpts. 1-2)",
           "Regular Expressions for Pattern Matching (chpt.)",
           "Text preprocessing, POS tagging and NER (chpt.)",
           "Interacting with APIs to import data from the web (chpt.)", 
           "Diving deep into the Twitter API (chpt.)", 
           "Supervised Learning with scikit-learn (course)",
           "Intro. to SQL (chpts. 1-2)",
           "Intro. to HTML (chpt.)"]

'''
**Optional DataCamp courses & chapters for further learning:**

- Introduction to data visualization with MatPlotLib
- Introduction to data visualization with ggplot2
- Intermediate python: loops
- Python data science toolbox (Part 1)
- Object-Oriented Programming in Python: OOP Fundamentals
- Regular expressions in Python (first three chapters)
- Introduction to natural language processing in Python
- Introduction to databases in Python
- Intermediate importing data in python
- Intermediate SQL queries
- Web scraping in python
'''

df["DataCamp module(s) (if any)"] = np.select(tomatch, 
                                              modules, 
                                              default = "")
'\n**Optional DataCamp courses & chapters for further learning:**\n\n- Introduction to data visualization with MatPlotLib\n- Introduction to data visualization with ggplot2\n- Intermediate python: loops\n- Python data science toolbox (Part 1)\n- Object-Oriented Programming in Python: OOP Fundamentals\n- Regular expressions in Python (first three chapters)\n- Introduction to natural language processing in Python\n- Introduction to databases in Python\n- Intermediate importing data in python\n- Intermediate SQL queries\n- Web scraping in python\n'
# add assignments to schedule, matching to dates/concepts conditionally
date_col = "Date" # date column to match on

due_dates = [df[date_col] == "Wednesday 01-11",
             df[date_col] == "Wednesday 01-18",
             df[date_col] == "Wednesday 02-01",
             df[date_col] == "Wednesday 02-08",
             df[date_col] == "Wednesday 02-15",
             df[date_col] == "Wednesday 02-22",
             df[date_col] == "Wednesday 03-01",
             df[date_col] == "Monday 03-06"]

# define assignments
assignments = ["Problem set one (solo; due Sunday 01-15)",
               "Problem set two (submit as group; due Sunday 01-22)",
               "Problem set three (due Wednesday 02-08)",
               "Final project milestone 1 (due Sunday 02-12)",
               "Problem set four (due Sunday 02-19)",
               "Final project milestone 2 (due Sunday 02-26) ",
               "Problem set five (due Friday 03-03)",
               "Final project presentation (paper due Monday 03-13)"]

df["Due (11:59 PM EST unless otherwise specified)"] = np.select(due_dates,
                                                                assignments,
                                                                default = "")
HTML(df.to_html(index=False, escape = False))
Date Concepts DataCamp module(s) (if any) Due (11:59 PM EST unless otherwise specified)
Wednesday 01-04 Course intro. & syllabus review (asynchronous)
Monday 01-09 Python basics (variables, lists, arrays) & software setup Intro. to Python (chpts. 2-3)
Wednesday 01-11 Pandas for data manipulation 1 + static data visualization Data Manipulation with pandas (course) Problem set one (solo; due Sunday 01-15)
Tuesday 01-17 Pandas 2 (wrap-up)
Wednesday 01-18 User-defined functions Problem set two (submit as group; due Sunday 01-22)
Monday 01-23 Workflow basics: command line & Github Intro. to Shell, Intro. to GitHub (chpts.)
Wednesday 01-25 Reshaping data
Monday 01-30 Catchup: Merging data & LaTeX Joining Data with pandas (chpts. 1-2)
Wednesday 02-01 Regular expressions (Regex) Regular Expressions for Pattern Matching (chpt.) Problem set three (due Wednesday 02-08)
Monday 02-06 Text-as-data 1 (text mining) Text preprocessing, POS tagging and NER (chpt.)
Wednesday 02-08 Text-as-data 2 (topic modeling) Final project milestone 1 (due Sunday 02-12)
Monday 02-13 APIs 1 (NAEP & Yelp) Interacting with APIs to import data from the web (chpt.)
Wednesday 02-15 APIs 2 (Twitter) Diving deep into the Twitter API (chpt.) Problem set four (due Sunday 02-19)
Monday 02-20 Supervised machine learning 1 (logit & regularization) Supervised Learning with scikit-learn (course)
Wednesday 02-22 Supervised machine learning 2 (Trees & optimization) Final project milestone 2 (due Sunday 02-26)
Monday 02-27 SQL Intro. to SQL (chpts. 1-2)
Wednesday 03-01 Final project work session Problem set five (due Friday 03-03)
Monday 03-06 Final presentations Final project presentation (paper due Monday 03-13)