From the course: Python for Data Visualization (2019)
Unlock this course with a free trial
Join today to access over 22,500 courses taught by industry experts.
Aggregate functions
From the course: Python for Data Visualization (2019)
Aggregate functions
- [Instructor] When working with a dataset, It is often a good idea to compute summary statistics. Summary statistics can tell you about your outliers, if your data is symmetrical, and how tightly grouped your data is. For the car loan dataset, where we have a payment table for a $34,690 loan at a 7.02% interest rate for a Toyota Sienna over 60 months, it would be interesting to find out how much total interest paid would be over the course of the loan. For this we're going to use a sum method. And what the sum method does, is it sums the values in a column. And the way this works, is I have the name of the DataFrame, df, I have single brackets. I have the column I'm interested in, in this case, interest_paid, closing single brackets, and I do .sum. And what this gives me is a total amount of interest paid over the course of the loan. And as you see, over the course of the loan the interest paid is $6,450.27. You can also use the sum method on an entire…
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
-
-
-
-
Introduction to pandas52s
-
Create sample data3m 50s
-
Load sample data2m 17s
-
Basic operations1m 57s
-
Slicing4m 12s
-
Filtering5m 39s
-
Renaming and deleting columns3m 16s
-
Aggregate functions2m 39s
-
Identifying missing data3m 41s
-
Removing or filling in missing data5m 3s
-
Convert pandas DataFrames to NumPy arrays or dictionaries1m 15s
-
Export pandas DataFrames to CSV and Excel files1m 28s
-
-
-
-