polars_arrow::compute::cast

Function utf8_to_dictionary

Source
pub fn utf8_to_dictionary<O: Offset, K: DictionaryKey>(
    from: &Utf8Array<O>,
) -> PolarsResult<DictionaryArray<K>>
Available on crate feature compute_cast only.
Expand description

Cast Utf8Array to DictionaryArray, also known as packing.

ยงErrors

This function errors if the maximum key is smaller than the number of distinct elements in the array.