Mean and median
Summary statistics are exactly what they sound like - they summarize many numbers in one statistic. For example, mean, median, minimum, maximum, and standard deviation are summary statistics. Calculating summary statistics allows you to get a better sense of your data, even if there's a lot of it.
sales
is available and pandas
is loaded as pd
.
This exercise is part of the course
Data Manipulation with pandas
Exercise instructions
- Explore your new DataFrame first by printing the first few rows of the
sales
DataFrame. - Print information about the columns in
sales
. - Print the mean of the
weekly_sales
column. - Print the median of the
weekly_sales
column.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Print the head of the sales DataFrame
print(____)
# Print the info about the sales DataFrame
print(____)
# Print the mean of weekly_sales
print(____)
# Print the median of weekly_sales
print(____)