[Numpy-discussion] compress function

Peter Verveer verveer at embl-heidelberg.de
Thu Jun 24 05:39:00 CDT 2004


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





More information about the Numpy-discussion mailing list