Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Challenge: Masking Sensitive Data in DataFrames | Protecting Sensitive Data
Python Security Best Practices
セクション 3.  5
single

single

bookChallenge: Masking Sensitive Data in DataFrames

メニューを表示するにはスワイプしてください

タスク

スワイプしてコーディングを開始

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.

解答

Switch to desktop実践的な練習のためにデスクトップに切り替える下記のオプションのいずれかを利用して、現在の場所から続行する
すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 3.  5
single

single

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

some-alt