How can you replace values in a NumPy array based on a condition using boolean indexing?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: easy
Interview Round: Other
Overview: Explain how to replace values in a NumPy array that meet a condition, both in place and as a new array. Tests boolean masks, combining conditions, and the casting, NaN and copy pitfalls that make conditional replacement go wrong.