Getting all the statistics
You can retrieve all major central tendency, dispersion, and shape statistics of a distribution at once with the pandas .describe() method. The default value of its optional percentiles argument corresponds with quartiles, but you can supply your own list of percentiles, as instead:
DataFrame.describe(percentiles=[.25, .5, .75])
The outputs of .describe() also include the total number of entries in the given series (which can be calculated with .count()), minimum value in the series (which can be calculated with .min()), and maximum value in the series (which can be calculated with .max()).
pandas as pd and numpy as np have been imported for you, and the income DataFrame from the previous exercise is available in your workspace.
This exercise will test your knowledge of the metrics and functions covered so far. Which of the following statements regarding the data in the 'Income per Capita' column in income is FALSE?
This exercise is part of the course
Importing and Managing Financial Data in Python
Hands-on interactive exercise
Turn theory into action with one of our interactive exercises
Start Exercise