Topics for the Midterm#

Week 1 Introduction to Python#

Learning objectives: You will learn to:

  • Identify and describe values of different types in Python code

  • Perform simple computations on these values

  • Store values and the results of computations in variables

  • Using built in functions

  • Run Python code and display results in a Jupyter notebook (like this one!)

Week 2 Strings, lists, conditionals and Loops#

You will be able to:

  • Use a variety of string methods

    • str.upper()

    • str.lower()

    • str.replace(old, new)

    • str.split()

  • Explain the difference between a function and a method

  • Write code using the list type

  • Use conditional statements (if statements) to control how Python is executed

  • Use loops, specifically for loops to repeat operations multiple times.

Week 3: Reading files, dictionaries, central tendency measures#

You will learn to:

  • read csv files

  • store data from a file into a list

  • use a new data type called a dictionary that stores key, value pairs

  • explain and compute central tendency statistics

  • summarize survey data using dictionaries and basic python

Week 4: Introduction to Pandas and Data Wrangling#

  • Introduction to working with (tabular) data using pandas

  • Learn about the two key data structures in pandas:

    • Series (1-dimensional)

    • DataFrame (2-dimensional).

  • Import a csv file into a pandas DataFrame

  • Selecting rows of a DataFrame using Boolean Series

  • Selecting columns of a DataFrame

  • Computing summary statistics on a DataFrame

  • Discuss some features the cencus and the kinds of data Stats Canada collects

  • Begin to use strategies to “clean” the data before computing various statistics on it.

Week 5: Data transformations#

  • Create a new column based on the values from another column

  • Rename columns

  • Replace missing value codes with np.nan

  • Describe the differences between categorical and quantitative data

For this test, you will not be asked to

  • use .groupby()

  • use .loc()

  • produce a box plot