| [ Web Proxy ] |
| Viewing: https://arrow.apache.org/docs/python/generated/pyarrow.dictionary.html | [Back] [Original] |
Section Navigation
Dictionary (categorical, or simply encoded) type.
DictionaryTypeExamples
Create an instance of dictionary type:
>>> import pyarrow as pa
>>> pa.dictionary(pa.int64(), pa.utf8())
DictionaryType(dictionary<values=string, indices=int64, ordered=0>)
Use dictionary type to create an array:
>>> pa.array(["a", "b", None, "d"], pa.dictionary(pa.int64(), pa.utf8()))
<pyarrow.lib.DictionaryArray object at ...>
...
-- dictionary:
[
"a",
"b",
"d"
]
-- indices:
[
0,
1,
null,
2
]
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 |