24 Jun
2004
24 Jun
'04
1:39 a.m.
The documentation of the compress function states that the condition must be equal to the given axis of the array that is compressed. e.g.:
a = array([[1,2],[3,4]]) print compress([1,0], a, axis = 1) [[1] [3]]
However, this also works fine:
print compress([[1,0],[0,1]], a) [1, 4]
which is great (I need that) but not documented. Is that behaviour intended? If so it maybe should be documented. Cheers, Peter