CommencerCommencer gratuitement

Top and bottom coding White House salaries

Top and bottom coding allow us to hide outliers and reduce the risk of identification without reducing data utility.

In this exercise, you're going to use salary data from the US White House from the years of 2019 and 2020. Apply the top and bottom technique for the column salary.

You will start by exploring the salaries, seeing how the bulk of the values lie in the center of the distribution. Based on your exploration, you will select reasonable top and bottom code values.

The DataFrame is loaded as wh2020.

Cet exercice fait partie du cours

Data Privacy and Anonymization in Python

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Plot a histogram of salaries
____
plt.show()
Modifier et exécuter le code