Numpy Tricks

reshape an array from row to col

>>> import numpy as np
>>> size1 = np.array([1, 2, 3, 4, 5, 6, 7])
>>> print(size1)
array([1, 2, 3, 4, 5, 6, 7])
>>> size2 = np.array([1, 2, 3, 4, 5, 6, 7]).reshape(-1, 1)
>>> print(size2)
array([ 1],
         [ 2],
         [ 3],
         [ 4],
         [ 5],
         [ 6],
         [ 7]])