[SciPy-user] read_array()

Joris De Ridder joris at ster.kuleuven.ac.be
Wed Feb 2 06:51:08 CST 2005


Hi,

I have two questions about the read_array() function in scipy.io.
As a simple example, suppose you have a file containing only 2 lines:

1. a 3
1. a 3

read_array("myfile.txt") gives the expected

array([[ 1.,  0.,  3.], 
         [ 1.,  0.,  3.]])

where 0 is inserted for a failed number conversion. However,
read_array("myfile.txt", missing = 2.)  still inserts 0 and not 2. Do I
misunderstand this option?

Secondly, the docstring mentions that you can also get "a tuple of 
output arrays of different types". I have tried several possibilities to get
2 arrays, one with the first column in a float array and a second one with
the third column in an integer array, but I don't seem to manage. I would
be very grateful if someone could email me a simple example on how to
do this.

Cheers,
Joris
 



More information about the SciPy-user mailing list