Masking / hiding of sensitive columns on display #67
Closed
Mjboothaus
started this conversation in
Ideas
Replies: 1 comment
-
Sorry for the very late reply here, but, we have the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When working with PII data it would be great to have the ability to either mask (via a number of methods eg constant value, label encoding, with synthetic data etc) or hide the column(s).
Not sure if this is best achieved via a decorator or an option within a table method.
Anyway just a suggestion which I imagine is a reasonably common use case to prevent data leakage during "publication" of tables. Cheers!
Simple example code:
def display_non_sensitive_columns(df, columns, method="constant", value="MASKED (PII)"):
"""
This function masks the specified columns in a pandas dataframe so that the data
can safely be displayed in e.g. reports (notebook outputs)
Beta Was this translation helpful? Give feedback.
All reactions