How do you add a new axis to a NumPy array using np.newaxis or np.expand_dims, and why is this useful for broadcasting?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: easy
Interview Round: Other
Overview: Explain how to insert a length-1 axis into a NumPy array with np.newaxis or np.expand_dims and why that matters for broadcasting. Tests understanding of array shapes, NumPy's broadcasting rules, views versus copies, and the shape mistakes that cause silent bugs in data code.