numpy的升维 将(2,)变成(2,1) a = np.array([1,2]) b = np.expand_dims(a, axis=1) numpy的降维 将(2,1)变成(2,) a = np.array([[1],[2]]) b = np.squeeze(a)