LoslegenKostenlos loslegen

Masking sensitive PII

You have been given a dataset containing Social Security numbers (SSN) of American citizens along with their city locations and age. If this was unreleased data only consented to be shared with us, when exposing it, a privacy breach would occur since you are disclosing data the subjects didn't expect us to share.

Your job will be to anonymize the data by applying partial masking to the Sensitive PII ssn. Remember, data masking is about hiding/obfuscating data to avoid data privacy breaches, while preserving the overall format and semantics.

The dataset has been loaded as insurance_df, but save the resulting data in masked_df to keep the original insurance_df intact.

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.

# Uniformly mask the SSN numbers with *
____

# See resulting DataFrame
print(____)
Code bearbeiten und ausführen