Week 2 — Description
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.
We'll do this through several resources and activities:
This week's material uses chapters 5 and 10 of the textbook.
The videos are also available as a Panopto playlist.
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.
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.
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.
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.
- Textbook section 5.1
Variables and Types
In this video, we learn the different types of data (variables) that we will encounter.
Datasheets for Datasets
Read Datasheets for Datasets by Timnit Gebru et al.
Week 2 Quiz
Submit the Week 2 quiz by Monday night.
This week's material uses chapters 5 and 10 of the textbook. We aren't getting to everything in those chapters though.
Groups and Aggregates
In this video, we discuss how compute aggregate statistics in Pandas.
- Notebook for this video
- Textbook 10.1–10.2
In this video, we discuss descriptive statistics for numeric variables.
This video introdues the concept of distributions, and how we can see the shape and layout of our data.
Data Sources and Bias
- Olteanu, Alexandra and Castillo, Carlos and Diaz, Fernando and Kiciman, Emre, Social Data: Biases, Methodological Pitfalls, and Ethical Boundaries (December 20, 2016). Frontiers in Big Data 2:13. doi: 10.3389/fdata.2019.00013, Available at SSRN: http://dx.doi.org/10.2139/ssrn.2886526
Codings and Encodings
This video talks more about how data is encoded, and what we need to document about that.
- float.exposed - explore floating-point numbers
The tutorial notebooks contain more info on the Python code, including more systematic overviews of the different Python and Pandas features.
We will not get to all Pandas features you might need in videos. These notebooks, the textbook, and the Pandas User Guide all provide additional information on Pandas, NumPy, and SciPy.
In a few videos, I have used the Palmer Penguins data set.
- Download data in 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!
Start working on Assignment 1. It is due at the end of Week 3.