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

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…

Contents