(100)
In [34]: %timeit [ x * y for x,y in zip(a,b) ]
1 loops, best of 3: 51.9 ?s per loop
In [35]: %timeit [ i*j for i in a for j in b ]
100 loops, best of 3: 2.78 ms per loop
Arnar
--
**
David M. Kaplan
Charge de Recherche 1
Institut de Recherche pour le
be
reimplimented using an nd_grid instance.
Cheers,
David
--
**
David M. Kaplan
Charge de Recherche 1
Institut de Recherche pour le Developpement
Centre de Recherche Halieutique Mediterraneenne et Tropicale
av. Jean Monnet
B.P. 171
34203 Sete cedex
France
Phone
--
**
David M. Kaplan
Charge de Recherche 1
Institut de Recherche pour le Developpement
Centre de Recherche Halieutique Mediterraneenne et Tropicale
av. Jean Monnet
B.P. 171
34203 Sete cedex
France
Phone: +33 (0)4 99 57 32 27
Fax: +33 (0)4 99 57 32 95
http
adding a ndgrid function to numpy that does the equivalent of
matlab [X,Y,Z,...] = ndgrid(x,y,z,...) and then making the current
meshgrid just call that changing the order of the first two arguments.
Cheers,
David
--
**
David M. Kaplan
Charge de Recherche 1