LoslegenKostenlos loslegen

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.

Diese Übung ist Teil des Kurses

Data Privacy and Anonymization in Python

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Import the Faker class
____

# Initialize the generator
____
Code bearbeiten und ausführen