how to read in an array in text file?
ulope at gmx.de
Sun Nov 9 12:17:39 CET 2003
"Yun Mao" <maoy at cis.upenn.edu> schrieb im Newsbeitrag
news:bokiea$bn00$1 at netnews.upenn.edu...
> Hi, what's the easy way of reading in a two-dimentional array from a text
> The text file looks like this:
> 0.1 1.1 2.3 12.1
> 0.3 33.0 4.1 1.1
> I'm using Numeric Python now. Other solutions are also welcome. Thanks a
f = file("myfile", "r")
data = [line.split() for line in f]
More information about the Python-list