Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Challenge: Masking Sensitive Data in DataFrames | Protecting Sensitive Data
Python Security Best Practices

bookChallenge: Masking Sensitive Data in DataFrames

Tehtävä

Swipe to start coding

Write a function that takes a pandas DataFrame and a list of sensitive column names, and returns a new DataFrame where all values in those sensitive columns are replaced with the string "MASKED". This helps prevent accidental exposure of sensitive data when displaying or sharing DataFrames.

  • The function must return a copy of the original DataFrame with the specified columns masked.
  • If a column in the sensitive list does not exist in the DataFrame, it must be ignored.
  • Non-sensitive columns must remain unchanged.

Ratkaisu

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 3. Luku 5
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

close

Awesome!

Completion rate improved to 5.56

bookChallenge: Masking Sensitive Data in DataFrames

Pyyhkäise näyttääksesi valikon

Tehtävä

Swipe to start coding

Write a function that takes a pandas DataFrame and a list of sensitive column names, and returns a new DataFrame where all values in those sensitive columns are replaced with the string "MASKED". This helps prevent accidental exposure of sensitive data when displaying or sharing DataFrames.

  • The function must return a copy of the original DataFrame with the specified columns masked.
  • If a column in the sensitive list does not exist in the DataFrame, it must be ignored.
  • Non-sensitive columns must remain unchanged.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 3. Luku 5
single

single

some-alt