What do np.squeeze and np.expand_dims do, and when would you use them?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: easy
Interview Round: Other
Overview: Asks what the NumPy functions squeeze and expand_dims do to an array's shape and when you would reach for each. It tests understanding of array dimensions, broadcasting rules, views versus copies, and preparing batch and channel axes for model inputs.