Re: [Numpy-discussion] cross product of two vectors as sets

2008-09-11 Thread Alan G Isaac
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://

[Numpy-discussion] cross product of two vectors as sets

2008-09-11 Thread Uwe Schmitt
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]