I came across the fact that numpy arrays are passed by reference at multiple places, but then when I execute the following code, why is there a difference betwe
The first function calculates (arr - 3), then assigns the local name arr to it, which doesn't affect the array data passed in. My guess is that in the second function, np.array overrides the -= operator, and operates in place on the array data.