[Numpy-discussion] ufunc oddities

Charles R Harris charlesr.harris at gmail.com
Sat May 24 21:36:57 EDT 2008


On Sat, May 24, 2008 at 7:31 PM, Charles R Harris <charlesr.harris at gmail.com>
wrote:

> Hi All,
>
> I'm writing tests for ufuncs and turned up some oddities:
>
> In [4]: degrees(True)
> Out[4]: 57.29578
>
> In [5]: radians(True)
> Out[5]: 0.017453292
>
> In [6]: sin(True)
> Out[6]: 0.84147096
>
> Do we want numeric functions to apply to booleans?
>

Some more:

In [15]: x
Out[15]: array([ True, False], dtype=bool)

In [16]: floor_divide(x,True)
Out[16]: array([1, 0], dtype=int8)

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20080524/5f1f250f/attachment.html>


More information about the NumPy-Discussion mailing list