Closed
Description
An example is better than words:
In [16]: cat test.txt
AAA
BBB
CCC
DDD
EEE
FFF
GGG
In [17]: with open("test.txt") as handle:
iterator = itertools.islice(handle, 3)
print list(iterator)
res = pandas.read_table(handle, squeeze=True, header=None)
....:
['AAA\n', 'BBB\n', 'CCC\n']
In [18]: res
Out[18]:
Empty DataFrame
Columns: array([], dtype=object)
Index: array([], dtype=object)
This works with the python engine. Notice that the handle is not really iterated through: when debugging I noticed that after iterator usage, the handle keeps on staying at the same file line (IOW the parser is not iterating on it at all).