On 11/8/06, Francesc Altet <[EMAIL PROTECTED]> wrote:
Try
I n [8]: tmp = fromfile('tmp.txt', sep=' ', dtype=int)
In [9]: a = tmp[:4].reshape(2,2)
In [10]: b = tmp[4:].reshape(2,2)
In [11]: a
Out[11]:
array([[1, 2],
[3, 9]])
In [12]: b
Out[12]:
array([[2, 3],
[4, 4]])
Chuck
A Dimecres 08 Novembre 2006 13:42, amit soni escrigué:
> Hi,
> i have a file with following format:
> 1 2
> 3 9
> 2 3
> 4 4
> I want to read it and then store the values into two matrices, s.t.
> A=[1 2;3 9]
> B=[2 3;4 4]
>
> Can anyone tell me how to do this in python?
> thanks
> Amit
Try
I n [8]: tmp = fromfile('tmp.txt', sep=' ', dtype=int)
In [9]: a = tmp[:4].reshape(2,2)
In [10]: b = tmp[4:].reshape(2,2)
In [11]: a
Out[11]:
array([[1, 2],
[3, 9]])
In [12]: b
Out[12]:
array([[2, 3],
[4, 4]])
------------------------------------------------------------------------- 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
_______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion