dtype() examples that used to work

Travis Oliphant oliphant.travis at ieee.org
Fri Oct 27 13:01:05 EDT 2006


Joris De Ridder wrote:
> Hi,
>
> The following did once work in NumPy:
>
>   
>>>> dtype([int16])
>>>> dtype([[int16]])
>>>> dtype([uint,int32])
>>>> dtype(['f8','S10'])
>>>>         
>
> but now they all generate a "TypeError: data type not understood". Why?
> I could not find the answer in help(dtype), the RecordArrays tutorial on 
> scipy.org, the NumPy release notes, nor in the NumPy book.
>   

It's in the release notes.   Look in the section from 1.0b2 to 1.0b3.  
It's highlighted with a Note:

*NOTE: * When creating data-type objects from lists, the list must be in 
array descriptor format. The "list of data-type objects" approach is no 
longer supported due to its ambiguity with the very common array 
descriptor approach. You can still get this behavior using a 
comma-separated string or changing your list to an array_descriptor: 
[('', x) for x in oldlist]


-Travis


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642




More information about the NumPy-Discussion mailing list