| [ Web Proxy ] |
| Viewing: https://arrow.apache.org/docs/python/generated/../../cpp/../python/generated/pyarrow.list_.html | [Back] [Original] |
Section Navigation
Create ListType instance from child data type or field.
DataTypeExamples
Create an instance of ListType:
>>> import pyarrow as pa
>>> pa.list_(pa.string())
ListType(list<item: string>)
>>> pa.list_(pa.int32(), 2)
FixedSizeListType(fixed_size_list<item: int32>[2])
Use the ListType to create a scalar:
>>> pa.scalar(['foo', None], type=pa.list_(pa.string(), 2))
<pyarrow.FixedSizeListScalar: ['foo', None]>
or an array:
>>> pa.array([[1, 2], [3, 4]], pa.list_(pa.int32(), 2))
<pyarrow.lib.FixedSizeListArray object at ...>
[
[
1,
2
],
[
3,
4
]
]
Copyright 2016-2026 Apache Software Foundation.
Apache Arrow, Arrow, Apache, the Apache logo, and the Apache Arrow project logo are either registered trademarks or trademarks of The Apache Software Foundation in the United States and other countries.
Created using Sphinx 9.1.0.
Built with the PyData Sphinx Theme 0.20.0.
| Web Proxy Viewer | New URL | Original Page |