[SciPy-user] what does 'd' mean in array([0.0, 1.0, 2.0, 3.0], 'd')

dmitrey openopt@ukr....
Thu Aug 30 10:51:04 CDT 2007


 >>> array([0.5, 1.5, 2.5, 3.5], dtype = 'd')
array([ 0.5,  1.5,  2.5,  3.5])

so no 'd' is shown
But I write this for other reason, then showing 'd' of course
the problem is that the array doesn't have 'ndim' attribute, and that 
makes error in my program
D

Matthieu Brucher wrote:
>
>
> 2007/8/30, dmitrey <openopt@ukr.net <mailto:openopt@ukr.net>>:
>
>     hi all,
>     during debug I obtain
>     >>> x
>     array([0.5, 1.5, 2.5, 3.5], 'd')
>
>     What does this 'd' mean?
>
>
>
> It's the type of the array (I think), and in this case, it indicates a 
> double array IIRC.
>  
>
>     How can I construct a = array(something) to obtain array of same type?
>
>
> numpy.array([0.5, 1.5, 2.5, 3.5], dtype = 'd')
>
> Matthieu
> ------------------------------------------------------------------------
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>   



More information about the SciPy-user mailing list