What is the purpose of the np.where() function?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: easy
Interview Round: Other
Overview: Asks what NumPy's np.where() function is for and how its one-argument and three-argument forms behave. Tests vectorized conditional logic, broadcasting, the shape of the index output, and common pitfalls when using the function on real arrays.