When I shrink a numpy array using the resize
method (i.e. the array gets smaller due to the resize
), is it guaranteed that no copy is made?
Example:
a = np.arange(10) # array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
a.resize(5, refcheck=False) # array([0, 1, 2, 3, 4])
From my understanding this should always be possible without making a copy. My question: Does the implementation indeed guarantee that this is always the case? Unfortunately the documentation of resize says nothing about it.