One is a one-dimensional array, the other is a two-dimensional array.
Example:
>>> import numpy as np >>> a = np.arange(4).reshape(4,1) >>> a array([[0], [1], [2], [3]]) >>> a.ravel() array([0, 1, 2, 3]) >>> a.squeeze() array([0, 1, 2, 3]) >>> a[:,0] array([0, 1, 2, 3]) >>> >>> a[:,0].shape (4,)
source share