[Numpy-discussion] Violation of array scalar multiplication rules?

Travis Oliphant oliphant@ee.byu....
Sun Apr 1 16:16:58 CDT 2007


Charles R Harris wrote:
> Just asking.
>
> In [35]: type(array(1.0)*2)
> Out[35]: <type 'numpy.float64'>
>
> In [36]: type(array(1.0))
> Out[36]: <type 'numpy.ndarray'>

No,  in ufuncs 0-d arrays are considered scalars, as are Python scalars 
and array scalars.

Also, ufuncs that result in scalars return NumPy scalars.

-Travis



More information about the Numpy-discussion mailing list