CommencerCommencer gratuitement

Removing names with faker

In this exercise, you will work with the 2018 NBA Salaries dataset. If this data weren't public, there would be a high risk of a re-identification attack. For example, since there is only one "Aaron Brooks" playing in the NBA, it could be possible to know other sensitive information like his exact salary per year. By removing personal names from the dataset, you can avoid potential damage to the people in it.

The .name() method will generate random names, including some female names. Besides doing this, you will also create names of one gender only.

The DataFrame has been loaded as nba.

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.

# Import the Faker class
____

# Initialize the generator
____
Modifier et exécuter le code