[Numpy-discussion] compress function

Todd Miller jmiller at stsci.edu
Fri Jun 25 08:48:12 EDT 2004


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





More information about the NumPy-Discussion mailing list