Set product could be produced as::
dp = list((xi,yi) for xi in x for yi in y)
dpasarray = np.array(dp)
but unless you really need the array,
you can use a generator.
Alan Isaac
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://
Hi,
I want to calculate the crossproduct (from set theory, not vectorspace
crossproduct) of two vectors x,y.
My method is as follows:
>>> x = array([1,2,3])
>>> y = array([4,5])
>>> xx, yy = meshgrid(x,y)
>>> array(zip(xx.flatten(), yy.flatten()))
array([[1, 4],
[2, 4],
[3, 4]