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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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