![](https://secure.gravatar.com/avatar/95f6094a015e05987b47e84e1c45cd78.jpg?s=120&d=mm&r=g)
I am now learning that my installation may be lacking. Travis seemed to confirm that I was not necessarily making a completely silly mistake, so the next step would be to clean up the installation. I great deal of information can be provided according to the instructions in INSTALL.txt. It seems wrong to send that to everyone. Can that also be a ticket? -Tony
Message: 5 Date: Mon, 06 Mar 2006 00:44:35 -0700 From: Travis Oliphant <oliphant.travis@ieee.org> Subject: Re: [SciPy-user] Data types To: SciPy Users List <scipy-user@scipy.net> Message-ID: <440BE863.5050306@ieee.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Tony Mannucci wrote:
Dear Scipy community,
I cannot find a clear statement as to allowable data types, and how these are specified. I am trying to read in an array using read_array. One of the arguments of the function is "atype", to specify the dtype of the output array. I cannot figure out what format the tuple atype is in.
While SciPy builds for NumPy, it has not been "fully" adapted in that it still uses a lot of Numeric idioms for data-types.
The read_array code is still using the old concept of "typecode" which is a one-character string (i.e. what dtype.char gives now).
There may also still be bugs still in SciPy.
If Numpy is like Numeric, then, according to "Python In A Nutshell", the array objects contain a single type. So, I cannot use several values, I would specify only one value for atype. This seems to differ from the scipy online documentation, suggesting atype could be a tuple. I realize the functionality is evolving.
In this case, the functionality was there but might have become broken in the transition to NumPy (or the result of an old bug). You should be able to specify a tuple for data-type. Most SciPy functions that take data-types need to be made aware of the new concept of data type in NumPy.
Along these lines, the following works: data = ARRIN.read_array('filename',columns=(0,2),atype='d')
and appears to give a double precision array (as evidenced from data.dtype.char = 'd'). However, using a few other strings for atype does not work, e.g. 'I', or 'L', etc. What do you get as the error?
Finally, the following does not seem to work: data = ARRIN.read_array('filename',columns=(2))
so reading a single column appears to cause a problem. The following DOES work: data = ARRIN.read_array('filename',columns=(0,2))
It would be easiest if you opened a ticket and attached an example file. Open tickets at
http://projects.scipy.org/scipy/scipy/timeline
Thanks,
-Travis
-- Tony Mannucci Supervisor, Ionospheric and Atmospheric Remote Sensing Group Mail-Stop 138-308, Tel > (818) 354-1699 Jet Propulsion Laboratory, Fax > (818) 393-5115 California Institute of Technology, Email > Tony.Mannucci@jpl.nasa.gov 4800 Oak Grove Drive, http://genesis.jpl.nasa.gov Pasadena, CA 91109
participants (1)
-
Tony Mannucci