Enum polars::prelude::RevMapping
source · pub enum RevMapping {
Global(HashMap<u32, u32, RandomState>, Utf8Array<i64>, u32),
Local(Utf8Array<i64>, u128),
}
Variants§
Global(HashMap<u32, u32, RandomState>, Utf8Array<i64>, u32)
Hashmap: maps the indexes from the global cache/categorical array to indexes in the local Utf8Array Utf8Array: caches the string values
Local(Utf8Array<i64>, 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) -> &Utf8Array<i64>
Available on crate feature dtype-categorical
only.
pub fn get_categories(&self) -> &Utf8Array<i64>
dtype-categorical
only.Get the categories in this RevMapping
pub fn build_local(categories: Utf8Array<i64>) -> 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 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