[Numpy-discussion] dtype attribute missing in numarray

Todd Miller jmiller at stsci.edu
Thu Jan 5 03:13:14 CST 2006


Sebastian Haase wrote:

>Hi,
>In an effort to follow the scipy_core development I just got the latest CVS 
>version of numarray.
>I was mainly interested in changing my code (and the tutorial that I write) 
>slowly but surely to use 'dtype' instead of 'type'.
>So I get this:
>  
>
>>>>na.__version__
>>>>        
>>>>
>'1.5.1'
>  
>
>>>>a = na.arange(10,dtype=na.float32)   # great !
>>>>a.dtypechar
>>>>        
>>>>
>'f'
>  
>
>>>>a.type()
>>>>        
>>>>
>Float32
>  
>
>>>>a.dtype
>>>>        
>>>>
>Traceback (most recent call last):
>  File "<input>", line 1, in ?
>AttributeError: 'NumArray' object has no attribute 'dtype'
>
>Is there a reason for not having the 'dtype' attribute !? I *really* never 
>liked the need for parenthesis when using 'a.type()' ...
>
>Thanks,
>Sebastian Haase
>  
>
I added .dtype returning the numarray numerical type object 
corresponding to the array.

Todd




More information about the Numpy-discussion mailing list