In [1]:
import numpy as np
In [2]:
x = np.arange(1, 11)
In [3]:
x
Out[3]:
In [4]:
x_row = x.reshape((1, -1))
x_row
Out[4]:
In [5]:
x_col = x[:, np.newaxis]
x_col
Out[5]:
In [6]:
np.dot(x_col, x_row)
Out[6]:
In [7]:
x_row * x_row
Out[7]:
In [8]:
x_row * x_col
Out[8]: