[Numpy-discussion] numarray-BUG in arr.maximum.reduce: negative axis returns "transpose"

Sebastian Haase haase at msg.ucsf.edu
Tue Mar 21 15:15:04 CST 2006


Hi,
I think I discovered another "ugly" bug:
If have an array with rank 4. I thought
numarray.maximum.reduce(arr, 1)
would be identical to
.numarray.maximum.reduce(arr, -3)
But instead I get something that looks more like the transpose of the first !
I tried to check the documentation for the numarray.maximum function,
but there is none at  [8. Array Functions 
http://stsdas.stsci.edu/numarray/numarray-1.5.html/node38.html]

This is a test a ran afterwards:
>>> q=na.arange(8)
>>> q.shape = (2,2,2)
>>> q
[[[0 1]
  [2 3]]
 [[4 5]
  [6 7]]]
>>> na.maximum.reduce(q)
[[4 5]
 [6 7]]
>>> na.maximum.reduce(q,0)
[[4 5]
 [6 7]]
>>> na.maximum.reduce(q,1)
[[2 3]
 [6 7]]
>>> na.maximum.reduce(q,-1)
[[1 3]
 [5 7]]

So its not really the transpose - but in any case it's something strange...

Thanks,
Sebastinan Haase




More information about the Numpy-discussion mailing list