[Numpy-tickets] [NumPy] #254: just fixin' the formatting

NumPy numpy-tickets at scipy.net
Thu Aug 17 20:08:37 CDT 2006


#254: just fixin' the formatting
------------------------+---------------------------------------------------
 Reporter:  guyer       |        Owner:  somebody
     Type:  defect      |       Status:  new     
 Priority:  normal      |    Milestone:          
Component:  numpy.core  |      Version:  devel   
 Severity:  normal      |   Resolution:          
 Keywords:              |  
------------------------+---------------------------------------------------
Changes (by guyer):

  * version:  => devel
  * summary:  ma & numpy arithmetic not commutative => just fixin' the
              formatting
  * component:  Other => numpy.core

Comment:

 {{{
 #!python
 >>> numpy.__version__
 '1.0b3.dev3032'
 >>> import numpy
 >>> from numpy.core import ma
 >>> a = ma.zeros((4,1))
 >>> a[2,0] = ma.masked
 >>> b = numpy.zeros((4,2))
 >>> a * b
 Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File
 "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3
 /site-packages/numpy/core/ma.py", line 944, in __mul__
     return multiply(self, other)
   File
 "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3
 /site-packages/numpy/core/ma.py", line 379, in __call__
     return masked_array(result, m)
   File
 "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3
 /site-packages/numpy/core/ma.py", line 1601, in masked_array
     return array(a, mask=mask, copy=0, fill_value=fill_value)
   File
 "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3
 /site-packages/numpy/core/ma.py", line 588, in __init__
     raise MAError, "Mask and data not compatible."
 numpy.core.ma.MAError: Mask and data not compatible.
 >>> b * a
 array(data =
  [[  0.00000000e+00   0.00000000e+00]
  [  0.00000000e+00   0.00000000e+00]
  [  1.00000000e+20   1.00000000e+20]
  [  0.00000000e+00   0.00000000e+00]],
       mask =
  [[False False]
  [False False]
  [True True]
  [False False]],
       fill_value=1e+20)
 }}}

-- 
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/254>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list