[Numpy-discussion] loadtxt stop
Neil Hodgson
hodgson.neil at yahoo.co.uk
Fri Sep 17 08:17:12 EDT 2010
Hi,
I been looking around and could spot anything on this. Quite often I want to
read a homogeneous block of data from within a file. The skiprows option is
great for missing out the section before the data starts, but if there is
anything below then loadtxt will choke. I wondered if there was a possibility
to put an endmarker= ?
For example, if I want to load text from a large! file that looks like this
header line
header line
1 2.0 3.0
2 4.5 5.7
...
500 4.3 5.4
END
more headers
more headers
1 2.0 3.0 3.14 1.1414
2 4.5 5.7 1.14 3.1459
...
500 4.3 5.4 0.000 0.001
END
Then I can use skiprows=2, but loadtxt will choke when it gets to 'END'. To
read t
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20100917/512d68ba/attachment.html>
More information about the NumPy-Discussion
mailing list