Enum polars::datatypes::RevMapping
source · pub enum RevMapping {
Global(HashMap<u32, u32, RandomState>, BinaryViewArrayGeneric<str>, u32),
Local(BinaryViewArrayGeneric<str>, u128),
}
Variants§
Global(HashMap<u32, u32, RandomState>, BinaryViewArrayGeneric<str>, u32)
Hashmap: maps the indexes from the global cache/categorical array to indexes in the local Utf8Array Utf8Array: caches the string values
Local(BinaryViewArrayGeneric<str>, u128)
Utf8Array: caches the string values and a hash of all values for quick comparison
Implementations§
source§impl RevMapping
impl RevMapping
pub fn is_global(&self) -> bool
Available on crate feature
dtype-categorical
only.pub fn is_local(&self) -> bool
Available on crate feature
dtype-categorical
only.sourcepub fn get_categories(&self) -> &BinaryViewArrayGeneric<str>
Available on crate feature dtype-categorical
only.
pub fn get_categories(&self) -> &BinaryViewArrayGeneric<str>
dtype-categorical
only.Get the categories in this RevMapping
pub fn build_local(categories: BinaryViewArrayGeneric<str>) -> RevMapping
Available on crate feature
dtype-categorical
only.sourcepub fn len(&self) -> usize
Available on crate feature dtype-categorical
only.
pub fn len(&self) -> usize
dtype-categorical
only.Get the length of the RevMapping
sourcepub fn get(&self, idx: u32) -> &str
Available on crate feature dtype-categorical
only.
pub fn get(&self, idx: u32) -> &str
dtype-categorical
only.Categorical
to str
pub fn get_optional(&self, idx: u32) -> Option<&str>
Available on crate feature
dtype-categorical
only.sourcepub fn same_src(&self, other: &RevMapping) -> bool
Available on crate feature dtype-categorical
only.
pub fn same_src(&self, other: &RevMapping) -> bool
dtype-categorical
only.Check if the categoricals have a compatible mapping
Trait Implementations§
source§impl Clone for RevMapping
impl Clone for RevMapping
source§fn clone(&self) -> RevMapping
fn clone(&self) -> RevMapping
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for RevMapping
impl Debug for RevMapping
source§impl Default for RevMapping
impl Default for RevMapping
source§fn default() -> RevMapping
fn default() -> RevMapping
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for RevMapping
impl RefUnwindSafe for RevMapping
impl Send for RevMapping
impl Sync for RevMapping
impl Unpin for RevMapping
impl UnwindSafe for RevMapping
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more