Week 2 — Description (8/29–9/2)#

The learning outcomes for this week are:

  • To load a data file into Pandas and describe its basic structural characteristics.

  • To identify the type of a variable and descriptive statistics appropriate to it.

  • To describe the distribution of a variable numerically and visually.

  • To describe how data was collected.

  • To reason about limitations of the collection of data.

This week’s material uses chapters 5 and 10 of 📖 Python for Data Analysis.

🧐 Content Overview#

Element Length

🎥 Describing Data


📃 What is a Dataset?

1950 words

🎥 Pandas Basics


🎥 Variables and Types


📃 Datasheets for Datasets

4100 words

🎥 Groups and Aggregates


🎥 Descriptive Statistics


🎥 Describing Distributions


🎥 Sources and Bias


🎥 Codings and Encodings


This week has 1h31m of video and 6050 words of assigned readings. This week’s videos are available in a Panopto folder.

📅 Deadlines#

  • Week 2 quiz at 8am on Thursday

🎥 Describing Data#

This video introduces the week’s topic: describing data and data sets. We discuss the pipeline by which phenomena become a data set.

📃 What is a Dataset?#

Read What is a Dataset? by Leigh Dodds. This article looks at how the term ‘data set’ is defined by different communities, and the common themes to these definitions.

This article does reference some concepts we haven’t yet gotten to. For example, when they talk about whether the data has been labeled for a particular task, they are referring to labels we would use for a prediction or classification task, which we will discuss in a few weeks when we talk about regression and classification. Don’t feel like you need to understand every concept in this article in your first read; understand what you can, and we’ll return to it.

🌠 MovieLens Data#

Download the MovieLens 25M Dataset. The Zip file is 250MB, and the files take about 1.2GB uncompressed.

You can use the smaller 20M or latest-small versions for practice if you want to play with a smaller version.

I will be using this dataset in the demo notebooks for this week.

Data Citation

Harper, F. M. and Konstan, J. A. (2015) ‘The MovieLens Datasets: History and Context’, ACM Transactions on Interactive Intelligent Systems, 5(4), pp. 19:1–19:19. DOI 10.1145/2827872.

This paper is not an assigned reading — it is here for your information.

🎥 Pandas Basics#

In this video, I introduce Pandas and the Pandas DataFrame data structure. We see how to load a CSV file and inspect the resulting data frame.


  • Notebook (used for slides as well)

  • Textbook section 5.1

🎥 Variables and Types#

In this video, we learn the different types of data (variables) that we will encounter.


In this video, I present categorical and ordinal variables as fixed and finite. While this describes any categorical and ordinal variables you are likely to encounter, this is not strictly speaking correct. It is possible for a categorical or ordinal variable to be (countably) infinite.


📃 Datasheets for Datasets#

Read Datasheets for Datasets by Timnit Gebru et al.

📖 Textbook Chapters#

This week’s material uses chapters 5 and 10 of 📖 Python for Data Analysis. We aren’t getting to everything in those chapters though.

🎥 Groups and Aggregates#

In this video, we discuss how compute aggregate statistics in Pandas.


🎥 Descriptive Statistics#

In this video, we discuss descriptive statistics for numeric variables.


This video introduces the following terms:

🎥 Describing Distributions#

This video introduces the concept of distributions, and how we can see the shape and layout of our data.


🎥 Data Sources and Bias#


🚩 Week 2 Quiz#

The Week 2 quiz will be over the material above this point.

🎥 Codings and Encodings#

This video talks more about how data is encoded, and what we need to document about that.


📓 Tutorial Notebooks#

The tutorial notebooks contain more info on the Python code, including more systematic overviews of the different Python and Pandas features. I recommend you particularly pay attention to the Python and Data tutorials.

We will not get to all Pandas features you might need in videos. These notebooks, the 📖 Python for Data Analysis textbook, and the Pandas User Guide all provide additional information on Pandas, NumPy, and SciPy.

✅ Practice#

In a few videos, I have used the Palmer Penguins data set.

  • Download ../resources/data/penguins.csv (provided under CC-0)

  • Look at the documentation and references in the source repository

  • Describe the distributions of the different variables numerically and graphically

  • See how many questions from Datasheets for Datasets you can find answers to in the penguin data documentation

For more practice, you can look at the paper for the MovieLens data and try to answer Datasheets questions for it too!

📩 Assignment 1#

Start working on Assignment 1. It is due at the end of Week 3.