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

Lou Pecora lou_boog2000@yahoo....
Thu Oct 11 10:23:39 CDT 2007


I have numpy version 1.0.3.1.  

zeros, ones, and empty  *all* return float arrays by
default.

--- Ryan Krauss <ryanlists@gmail.com> wrote:

> 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
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
>
http://projects.scipy.org/mailman/listinfo/scipy-user
> 


-- Lou Pecora,   my views are my own.


       
____________________________________________________________________________________
Pinpoint customers who are looking for what you sell. 
http://searchmarketing.yahoo.com/


More information about the SciPy-user mailing list