[SciPy-user] bug in scipy array?

Kilian Koepsell python at koepsell.de
Tue Mar 28 14:52:48 CST 2006


i came across the following strange behavior while multiplying a  
scipy array:
a[:,2:] gives a column of zeros if a is an 2x2 array (that is correct)
but if i multiply this column by zero, it affects the element a[2,0]  
which is probably a bug.

  >>> from scipy import *
  >>> a = array([[1,2],[3,4]])
  >>> a
  array([[1, 2],
         [3, 4]])
  >>> a[:,2:]
  zeros((2, 0), 'l')
  >>> a[:,2:] *= 0
  >>> a
  array([[1, 2],
         [0, 4]])

i am using scipy 0.3.2 with python 2.4.2 and Mac OSX 10.4.5.

thanks for any help/comment.

More information about the SciPy-user mailing list