Suppose I have the following (in python 3.7)
x = np.array([2,4,6])
y = np.array([3,5])
How can I obtain the output
np.array([[2, 2],
[3, 4],
[3, 5]])
Basically making use of the two arrays as the "axis" of my new matrix, and for each entry of the new matrix, take the min(row, col), without using any loops.
np.minimum(*np.meshgrid(y,x))outerany ufunc likeminimum:np.minimum.outer(x,y)