Function primitive_to_dictionary

Source
pub fn primitive_to_dictionary<T: NativeType + Eq + Hash, K: DictionaryKey>(
    from: &PrimitiveArray<T>,
) -> PolarsResult<DictionaryArray<K>>
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.