reading file contents to an array (newbie)
dd55 at cornell.edu
Wed Jul 7 01:07:58 CEST 2004
I am trying to learn how to read a delimited file into a numarray. I
have a working strategy, but it doesnt seem very elegant: manually
changing whitespace delimiters to commas, evaluating the lines to a list
of tuples, creating a numarray object from that list.
Could I get some suggestions on how to do this more Pythonically? I have
to read pretty large files, so this approach is probably way to slow.
Here is my code:
from numarray import *
for line in tempData:
More information about the Python-list