[SciPy-dev] Default type behaviour of array

Jonathan Taylor jonathan.taylor at utoronto.ca
Sat Nov 12 01:00:10 CST 2005


Hi,

I have had quite a bit of success moving some of my R scripts to scipy. 
Today I was creating a matrix of zeros and assigning some elements
uniform distributed values from -1 to 1.  I couldnt figure out for quite
a bit why my matrix remained zerod.  So I guess that is because zeros
returns an int array by default.  I would have expected a float array by
default.  Maybe there is a good reason for this though.

Also, maybe it should complain when you put floats into an integer array
instead of just rounding the elements.  That is, maybe you should have
to explicity round the elements?

Just some thoughts.
Jon.




More information about the Scipy-dev mailing list