I have just started using NumPy. What is the difference between resize and reshape for arrays?
resize
reshape
One more point is:
np.reshape can take -1 in one dimension. np.resize can't.
Example as below:
arr = np.arange(20) arr.resize(5, 2, 2) arr.reshape(2, 2, -1)