[Numpy-discussion] Behavior of array scalars

David M. Cooke cookedm at physics.mcmaster.ca
Fri Feb 17 16:21:08 CST 2006


Travis Oliphant <oliphant at ee.byu.edu> writes:

> Consider...
>
> a = rand(5,5)
> b = mat(a)
>
> a += b
>
> What do you think the type of a now is?  What should it be?
>
> Currently,  this code would change a from an array to a matrix because
>
> add(a,b,a) returns a matrix.
>
> I'm thinking that we should establish the rule that if output arrays
> are given, then what is returned should just be those output arrays...

+1.

-- 
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke                      http://arbutus.physics.mcmaster.ca/dmc/
|cookedm at physics.mcmaster.ca




More information about the Numpy-discussion mailing list