import numpy
A = numpy.loadtxt('foo.data') #A is a float array
B = M.astype(int) #B is an int array
M = Matrix(RDF, list(A)) #M is a RDF matrix
N = Matrix(ZZ, list(B)) #N is an Integer matrix
Note that numpy arrays also have a .tolist() method, with 'smarter'
unpacking behavior:
In [16]: a = zeros((2,3))
In [17]: list(a)
Out[17]: [array([ 0., 0., 0.]), array([ 0., 0., 0.])]
In [18]: a.tolist()
Out[18]: [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]
It may be useful for some cases.
Cheers,
f