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

bookChallenge: Masking Sensitive Data in DataFrames

Tarefa

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.

Solução

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 5
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

Suggested prompts:

Can you explain this in simpler terms?

What are the main takeaways from this?

Can you give me an example?

close

Awesome!

Completion rate improved to 5.56

bookChallenge: Masking Sensitive Data in DataFrames

Deslize para mostrar o menu

Tarefa

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.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 5
single

single

some-alt