A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://arrow.apache.org/docs/python/api/../generated/pyarrow.dictionary.html below:

pyarrow.dictionary — Apache Arrow v21.0.0

pyarrow.dictionary#
pyarrow.dictionary(index_type, value_type, bool ordered=False) DictionaryType#

Dictionary (categorical, or simply encoded) type.

Parameters:
index_typeDataType
value_typeDataType
orderedbool
Returns:
typeDictionaryType

Examples

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
  ]

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4