Save this video free

Stats 21 - Lecture 14 - Pandas Grouping Aggregates

Miles Chen · 33:48 · Watch on YouTube

Stats 21 - Lecture 14 - Pandas Grouping Aggregates Watch on YouTube →

Overview

Miles Chen uses the 891-row, 12-column Titanic DataFrame to teach pandas missing-value checks, category counts, duplicate detection, and grouped aggregation. The lecture emphasizes interpreting results carefully: missing ages reduce the usable sample to 714, `size` and `count` answer different questions, and choices such as dropping rows or filling values can bias conclusions.

Key takeaways

Chapters

0:00 Titanic DataFrame Structure and Missing-Value Checks
8:49 Missingness Rates, Value Counts, and Duplicate Detection
15:38 Group Titanic Passengers by Class and Aggregate Outcomes
20:56 Grouping with Missing Categories and Choosing Denominators
25:59 Clean Category Labels and Convert Numeric Strings
29:50 Nullable Integer Values and Aggregates with No Observations

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

Transcript excerpt

0:02 Okay, I apologize for all of the computer struggles but it it happens. Okay. All right, so we've been working with this Titanic data set. We introduced pandas on Monday and today we want to talk about just how do we uh you know, handle some grouping information and information you know, for each record. Okay. So here we set So we think about our our data frame here. It's got 891 rows, 12 columns. Okay. Um

0:49 each row is a a record and we have stuff like passenger class and whether they survived, uh their age at the time and you know, just stuff stuff like that. Okay. We've got you know, some of these variables are grouping variables. Some of them have missing values. Things are coded. Okay, so we can just ask so for some information. We can just do titanic.info and it just gives you kind of like this is how many values we've got that are not missing. Okay, to see if things are missing, okay. Um we have dot isna to see if it's missing and dot notna if it's not missing. Okay.

1:39 Um This is like a new thing. All right. It took you should always have to do like isna and then like false but now you can just go directly not missing and and so anyway, you can just say all right, age. So question is this if I just stop right here so this is a review from Monday, is this a data frame, a series, an array? It is a series, okay? So, we have a square bracket with uh the name in quotes is going to select a series. If we had square bracket with square bracket,

2:25 and that that would return a data frame. Okay, so this is a series. A series is

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.