[Numpy-discussion] ufunc oddities

Charles R Harris charlesr.harris@gmail....
Sat May 24 20:36:57 CDT 2008


On Sat, May 24, 2008 at 7:31 PM, Charles R Harris <charlesr.harris@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://projects.scipy.org/pipermail/numpy-discussion/attachments/20080524/5f1f250f/attachment.html 


More information about the Numpy-discussion mailing list