pyarrow.compute.dictionary_encode#

pyarrow.compute.dictionary_encode(array, /, null_encoding='mask', *, options=None, memory_pool=None)#

Dictionary-encode array.

Return a dictionary-encoded version of the input array. This function does nothing if the input is already a dictionary array.

Parameters:
arrayArray-like

Argument to compute function.

null_encodingstr, default “mask”

How to encode nulls in the input. Accepted values are “mask” (null inputs emit a null in the indices array), “encode” (null inputs emit a non-null index pointing to a null value in the dictionary array).

optionspyarrow.compute.DictionaryEncodeOptions, optional

Alternative way of passing options.

memory_poolpyarrow.MemoryPool, optional

If not passed, will allocate memory from the default memory pool.