[NumPy-Tickets] [NumPy] #1422: ma._extrema_operation subclasses' reduce method raise ValueError...

NumPy Trac numpy-tickets@scipy....
Sat Mar 6 14:24:35 CST 2010


#1422: ma._extrema_operation subclasses' reduce method raise ValueError...
----------------------------------------------------+-----------------------
 Reporter:  dgoldsmith                              |       Owner:  pierregm
     Type:  defect                                  |      Status:  new     
 Priority:  high                                    |   Milestone:          
Component:  numpy.ma                                |     Version:  1.4.0   
 Keywords:  ma.reduce ValueError "zero-size array"  |  
----------------------------------------------------+-----------------------

Comment(by dgoldsmith):

 Here's a small self-contained example that reproduces the problem as it
 arises from matplotlib's imshow (thanks to Friedrich Romstedt
 <friedrichromstedt@gmail.com> for providing it):
 {{{
 >>> from matplotlib.figure import Figure
 >>> ax = Figure().add_subplot(1,1,1)
 >>> argW = numpy.asarray([[0, 1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11]])
 >>> argW[0:1, 0:0]
 array([], shape=(1, 0), dtype=int32)
 >>> ax.imshow(argW[0:1, 0:0])
 Traceback (most recent call last):
   File "<input>", line 1, in <module>
   File "C:\Python254\lib\site-packages\matplotlib\axes.py", line 6261, in
 imshow
     im.autoscale_None()
   File "C:\Python254\lib\site-packages\matplotlib\cm.py", line 236, in
 autoscale_None
     self.norm.autoscale_None(self._A)
   File "C:\Python254\lib\site-packages\matplotlib\colors.py", line 792, in
 autoscale_None
     if self.vmin is None: self.vmin = ma.minimum(A)
   File "C:\Python254\Lib\site-packages\numpy\ma\core.py", line 5555, in
 __call__
     return self.reduce(a)
   File "C:\Python254\Lib\site-packages\numpy\ma\core.py", line 5570, in
 reduce
     t = self.ufunc.reduce(target, **kargs)
 ValueError: zero-size array to ufunc.reduce without identity
 }}}

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


More information about the NumPy-Tickets mailing list