Save this video free

Stats 21 - Lecture 13 - Pandas DataFrame basics

Miles Chen · 48:33 · Watch on YouTube

Stats 21 - Lecture 13 - Pandas DataFrame basics Watch on YouTube →

Overview

Miles Chen introduces Pandas DataFrames as labeled, two-dimensional tables built from one-dimensional Series, using the 891-row Titanic dataset and a small Avengers example. He demonstrates importing and inspecting data, selecting with brackets and .loc/.iloc, filtering and sorting rows, creating columns, and handling label alignment, mutation, NumPy conversion, and numeric summaries.

Key takeaways

Chapters

0:00 Pandas DataFrames and Series: The Table and Column Model
3:05 Importing and Inspecting the 891-Row Titanic Dataset
10:15 Selecting Columns: Series Versus One-Column DataFrames
14:19 Building DataFrames and Indexing with .loc and .iloc
22:23 Filtering Titanic Rows with Boolean Masks and Conditions
27:09 Adding Columns, Updating Values, and Sorting DataFrames
34:14 Chaining Titanic Filters and Sorts to Find High-Fare Passengers
40:43 String Searches, Label Slices, and Automatic Series Alignment
44:06 Series Independence, NumPy Conversion, and .describe()

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:02 Okay. All right. Well, uh happy Monday and uh thank you for joining me and being here. I forgot my microphone, so I'm going to just have to talk and use my teacher voice and hopefully that's good enough. All right. Um so, we are taking uh a slight detour from base Python and kind of these programming aspects and the different data types and we are now looking at um you know, doing data science and data wrangling and data analysis within Python. And so, uh for that we had to introduce NumPy, which is um

0:51 which gave us the array. And uh and that's an important uh data structure that uh that we will use. And today we are going to uh introduce Pandas, okay? And so, Pandas is um uh the the package or module that allows us to use data frames, okay? So, data frames are basically tables, tables of data. You're familiar with the data frame in R and Pandas implements uh its own type of thing and um and so, yeah, we get these two-dimensional things. We got rows and columns. And the columns

1:38 can have different data types, okay? Uh and then Pandas uh structures each column as what we call a series, okay? A series um is uh basically a one-dimensional object with labels and a data type. And a series often uses NumPy arrays to store its values, okay? All right. So, anyway, uh we are going to um import pandas. And uh we import it as pd, okay? And I believe the version that I put in the requirements file is pandas 3.0, 3.0.1.

2:30 Um and so, there's a So, if you read um other pandas documentation and tutorials and stuff, they might refer to a slightly older version of pandas where,

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Miles Chen.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.