From the course: Data Analysis with Python and Pandas
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Challenge: groupby()
From the course: Data Analysis with Python and Pandas
Challenge: groupby()
- [Presenter] All right, everybody. We have a new email in. This time, it's from Phoebe Product who works in our merchandising department. Subject line is "Top Stores by Transactions." She writes us, "Hi there, it's Phoebe. "I want to create some custom displays "for our busiest stores. "Can you return a table containing the top 10 stores "by total transactions in the data? "Make sure they're sorted from highest to lowest. "Thanks." She also says, "P.S. Let me know "if you want to hear my music." I don't know if I want to, but feel free to reply how you want. If we take a look at our results preview, we can see we have an aggregated table with our store number in our index, with Store 44 at the top, having about 7.2 million transactions. And our 10th highest selling store was Store 11 with about 3.97 million transactions. We're going to be working out of our Section Four notebook. We made it through data frames. Let's take a quick look at that. All right, so as usual you want to���
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Basic aggregations4m 14s
-
(Locked)
The groupby() method4m 32s
-
(Locked)
Challenge: groupby()1m 18s
-
(Locked)
Solution: groupby()2m 11s
-
(Locked)
Grouping by multiple columns4m 41s
-
(Locked)
Challenge: Grouping by multiple columns1m 9s
-
(Locked)
Solution: Grouping by multiple columns3m
-
(Locked)
MultiIndex DataFrames7m 39s
-
(Locked)
Modifying a MultiIndex4m 25s
-
(Locked)
Challenge: MultiIndex DataFrames1m 17s
-
(Locked)
Solution: MultiIndex DataFrames4m 1s
-
(Locked)
The agg() method and named aggregations7m 22s
-
(Locked)
Challenge: The agg() method1m 22s
-
(Locked)
Solution: The agg() method3m 1s
-
(Locked)
Pro tip: Transforming DataFrames6m 50s
-
(Locked)
Challenge: Transforming a DataFrame1m 18s
-
(Locked)
Solution: Transforming a DataFrame4m 27s
-
(Locked)
Pivot tables in pandas6m 40s
-
(Locked)
Multiple aggregation pivot tables2m 54s
-
(Locked)
Pro tip: Pivot table heatmaps4m 35s
-
(Locked)
Melting DataFrames6m 26s
-
(Locked)
Challenge: pivot() and melt()1m 4s
-
(Locked)
Solution: pivot() and melt()5m 39s
-
(Locked)
Key takeaways1m 53s
-
(Locked)
-
-
-
-
-
-