import numpy as np
# 1-d array
a1 = np.array([1,2,3])
a1,a1.shape
(array([1, 2, 3]), (3,))
# 1x3 matrix
a2 = np.array([1,2,3]).reshape(1,-1)
a2,a2.shape
array([[1, 2, 3]])
# 3x1 matrix
a3 = np.array([1,2,3]).reshape(-1,1)
a3,a3.shape
(array([[1], [2], [3]]), (3, 1))
np.array([1,2,3]).reshape(1).shape
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-9-1e5c8fdd3fca> in <module>() ----> 1 np.array([1,2,3]).reshape(1).shape ValueError: total size of new array must be unchanged