[SciPy-user] changing the default data type of zeros and ones

Ryan Krauss ryanlists@gmail....
Thu Oct 11 10:05:25 CDT 2007


I have successfully coerced my mechatronics students into using
Scipy/Numpy this semester for signal processing and lti type stuff.  I
think it is going fairly well.  One common tripping point has been
using the zeros or ones functions to create vectors that will later be
loaded with data.  For mechanical engineering students coming from a
Matlab background, the idea that everything isn't a floating point
number seems to be a bit strange.  I understand the computer science
arguments for zeros and ones returning integers by default, but is
this something we are willing to consider changing?

Does the empty function meet this need?  What does it mean to say that
the values are uninitialized?  Could they really be anything?  Could
this cause problems if a value wasn't loaded into each slot in the
array?

When I run empty on my computer, I get a fair number of things that
are really, really small:
4.24399162e-312,   3.06953241e-267,   3.06982818e-267,
         3.06956199e-267,  -9.94445468e-041,   2.25029465e-269,
        -1.31049432e-039,   4.94065646e-324,

Any thoughts?

Thanks,

Ryan


More information about the SciPy-user mailing list