Session Ready
Exercise

Distribution of income

In many datasets, the distribution of income is approximately lognormal, which means that the logarithms of the incomes fit a normal distribution. We'll see whether that's true for the GSS data. As a first step, you'll compute the mean and standard deviation of the log of incomes using NumPy's np.log10() function.

Then, you'll use the computed mean and standard deviation to make a norm object using the scipy.stats.norm() function.

Instructions
100 XP
  • Extract 'realinc' from gss and compute its logarithm using np.log10().
  • Compute the mean and standard deviation of the result.
  • Make a norm object by passing the computed mean and standard deviation to norm().