## Python: fastest way of adding columns containing pairwise products of column elements

Suppose I have a numpy array
X = np.array([[1,2,3],
[4,5,6],
[7,8,9]])
I want to extend this matrix by adding (on the left) the columns resulting by multiplying together all possible pairs of columns. In this example it...

more
»