series str as an iterator · Issue #3638 · pandas-dev/pandas (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@hayd

Description

@hayd

This was noticed on SO by @dsm. It seems that the Series str method is a never ending iterator. I have no idea whether this should be classified as a bug, or just misuse. But here goes:

In [224]: g = (i for i in ds.str)

In [225]: next(g)
Out[225]:
google       NaN
wikimedia    NaN
wikipedia    NaN
wikitravel   NaN
dtype: float64

In [226]: next(g)
Out[226]:
google       NaN
wikimedia    NaN
wikipedia    NaN
wikitravel   NaN
dtype: float64

In [227]: next(g)
Out[227]:
google       NaN
wikimedia    NaN
wikipedia    NaN
wikitravel   NaN
dtype: float64

In [228]: next(g)
Out[228]:
google       NaN
wikimedia    NaN
wikipedia    NaN
wikitravel   NaN
dtype: float64

In [229]: list(g)  # lalalala