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
.
Diese Übung ist Teil des Kurses
Data Privacy and Anonymization in Python
Interaktive Übung
Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.
# Plot a histogram of salaries
____
plt.show()