1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Statistics in Python

Connected

Exercise

Mean vs. median

In the video, you learned that the mean is the sum of all the data points divided by the total number of data points, and the median is the middle value of the dataset where 50% of the data is less than the median, and 50% of the data is greater than the median. In this exercise, you'll compare these two measures of center.

pandas is loaded as pd, numpy is loaded as np, and food_consumption is available.

Instructions 1/4

undefined XP
    1
    2
    3
    4
  • Import matplotlib.pyplot with the alias plt.
  • Subset food_consumption to get the rows where food_category is 'rice'.
  • Create a histogram of co2_emission in rice_consumption DataFrame and show the plot.