[SciPy-user] scipy.io.write_array and the precision
ryanlists at gmail.com
Thu Apr 6 08:32:12 CDT 2006
I see this as well:
In : mymat
array([[ 0.19463406, 0.92311955, 0.18562841],
[ 0.31952113, 0.42110699, 0.91320285],
[ 0.2302922 , 0.04191094, 0.13106267]])
mymat.tofile('mymat.txt',sep='\t') or sep=' ' produces a file with
only one line.
In : mat2=scipy.io.read_array('mymat.txt')
In : mat2
array([ 0.19463406, 0.92311955, 0.18562841, 0.31952113, 0.42110699,
0.91320285, 0.2302922 , 0.04191094, 0.13106267])
In : shape(mat2)
So, how do you read these back in without knowing their shape ahead of time?
On 4/6/06, jaonary at free.fr <jaonary at free.fr> wrote:
> Selon Travis Oliphant <oliphant.travis at ieee.org>:
> > arr.tofile('myfile.txt',sep=' ')
> > will do it...
> Thank your for your answer. In fact, with arr.tofile() things go well, there's
> just one more litte problem. With this method (tofile) my array is written in
> one line. How can I do to put one row in one line ? Also, where can I find more
> information on these built-in method in the array object and related stuff ?
> It tried something like this :
> but there's nothing and so on the web sit.
> It seems that the documentation on numpy is difficult to find :-)
> SciPy-user mailing list
> SciPy-user at scipy.net
More information about the SciPy-user