[Numpy-discussion] Tuple outer product?

Alan G Isaac aisaac@american....
Fri Sep 25 18:50:05 CDT 2009


> Alan G Isaac wrote:
>> That's just a slow implementation of meshgrid:
>> np.meshgrid(a,b).transpose().tolist()
>> Gives you the same thing.

On 9/25/2009 6:38 PM, Mads Ipsen wrote:
> Yes, but it should also work for [2.1,3.2,4.5] combined with
> [4.6,-2.3,5.6] - forgot to tell that.

No problem: a meshgrid is not an mgrid.
But again, itertools.product will be **much** faster.

Alan Isaac



More information about the NumPy-Discussion mailing list