Session Ready
Exercise

Visualizing international income distribution

seaborn is a Python visualization library for statistical data visualization based on matplotlib.

By default, the distplot() function in the seaborn package creates a histogram, where data is grouped into ranges and and plotted as bars, and fits a kernel density estimation (KDE), or smoothed histogram. You can also use distplot() to create another kind of graph called a rugplot, which adds markers at the bottom of the chart to indicate the density of observations along the x axis.

seaborn.distplot(a, bins=None, hist=True, kde=True, rug=False, ...)

In previous exercises, you created a quantile plot which provided a fairly granular sense of the level of income per capita at different points of the distribution. Here, you will use distplot() to get the full picture!

pandas has been imported as pd, and the income DataFrame from the previous exercise is available in your workspace.

Instructions
100 XP
  • Import seaborn as sns and matplotlib.pyplot as plt.
  • Print the summary statistics provided by .describe().
  • Plot and show a basic histogram of the 'Income per Capita' column with .distplot().
  • Create and show a rugplot of the same data by setting the additional arguments bins equal to 50, kde to False, and rug to True.