You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "pitrou (via GitHub)" <gi...@apache.org> on 2026/01/14 13:51:49 UTC
Re: [I] [Python] Make `ChunkedArray` & `Array` iterable [arrow]
pitrou commented on issue #34495:
URL: https://github.com/apache/arrow/issues/34495#issuecomment-3749659671
This is actually working as expected, but you have to call `iter` not `next`:
```python
>>> a = pa.array([4, 5, 6, None])
>>> iter(a)
<_cython_3_2_4.generator at 0x7c78bd2ea200>
>>> list(a)
[<pyarrow.Int64Scalar: 4>,
<pyarrow.Int64Scalar: 5>,
<pyarrow.Int64Scalar: 6>,
<pyarrow.Int64Scalar: None>]
>>> iter(pa.chunked_array([a, a]))
<_cython_3_2_4.generator at 0x7c78bd2e9ee0>
>>> list(pa.chunked_array([a, a]))
[<pyarrow.Int64Scalar: 4>,
<pyarrow.Int64Scalar: 5>,
<pyarrow.Int64Scalar: 6>,
<pyarrow.Int64Scalar: None>,
<pyarrow.Int64Scalar: 4>,
<pyarrow.Int64Scalar: 5>,
<pyarrow.Int64Scalar: 6>,
<pyarrow.Int64Scalar: None>]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org