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

bookChallenge: Masking Sensitive Data in DataFrames

Tarea

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.

Solución

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 3. Capítulo 5
single

single

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

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

Desliza para mostrar el menú

Tarea

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.

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 3. Capítulo 5
single

single

some-alt