[NumPy-Tickets] [NumPy] #966: Enhance meshgrid to generate 3D grids + add option for sparse grids

NumPy Trac numpy-tickets@scipy....
Tue Nov 8 01:37:33 CST 2011


#966: Enhance meshgrid  to generate 3D grids + add option for sparse grids
-------------------------+--------------------------------------------------
 Reporter:  pbrod        |       Owner:  charris     
     Type:  enhancement  |      Status:  needs_review
 Priority:  normal       |   Milestone:  Unscheduled 
Component:  numpy.lib    |     Version:  devel       
 Keywords:  meshgrid     |  
-------------------------+--------------------------------------------------

Comment(by pbrod):

 The timings for the original version:
 {{{

 In [10]: x = np.arange(10)
 In [11]: %timeit X,Y = np.meshgrid(x,x)
 100000 loops, best of 3: 9.79 us per loop
 }}}
 compared to the new proposal:
 {{{
 In [12]: %timeit X,Y = meshgrid(x,x)
 10000 loops, best of 3: 33.4 us per loop

 In [13]: %timeit X,Y = meshgrid(x,x, sparse=True)
 10000 loops, best of 3: 18.3 us per loop

 In [14]: %timeit X,Y = meshgrid(x,x, sparse=True, copy=False)
 10000 loops, best of 3: 15 us per loop

 In [15]: %timeit X,Y = meshgrid(x,x, sparse=True, copy=False,
 indexing='ij')
 100000 loops, best of 3: 12.3 us per loop
 }}}

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/966#comment:5>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list