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
On Thu, 2004-06-24 at 08:38, Peter Verveer wrote:
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?
It is most likely accidental, but great is great.
If so it maybe should be documented.
I filed a bug report but I'm not sure when I'll be *able* to do it. Regards, Todd
participants (2)
-
Peter Verveer
-
Todd Miller