pub fn primitive_to_dictionary<T, K>(
from: &PrimitiveArray<T>,
) -> Result<DictionaryArray<K>, PolarsError>
Expand description
Cast PrimitiveArray
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.