Struct polars_core::prelude::CategoricalChunked
source · pub struct CategoricalChunked { /* private fields */ }
Available on crate feature
dtype-categorical
only.Implementations§
source§impl CategoricalChunked
impl CategoricalChunked
pub fn sort_with(&self, options: SortOptions) -> CategoricalChunked
sourcepub fn sort(&self, reverse: bool) -> CategoricalChunked
pub fn sort(&self, reverse: bool) -> CategoricalChunked
Returned a sorted ChunkedArray
.
sourcepub fn argsort(&self, options: SortOptions) -> IdxCa
pub fn argsort(&self, options: SortOptions) -> IdxCa
Retrieve the indexes needed to sort this array.
source§impl CategoricalChunked
impl CategoricalChunked
sourcepub unsafe fn from_global_indices_unchecked(
cats: UInt32Chunked
) -> CategoricalChunked
pub unsafe fn from_global_indices_unchecked(
cats: UInt32Chunked
) -> CategoricalChunked
Create a CategoricalChunked
from a categorical indices. The indices will
probe the global string cache.
Safety
This does not do any bound checks
source§impl CategoricalChunked
impl CategoricalChunked
pub fn append(&mut self, other: &Self) -> PolarsResult<()>
source§impl CategoricalChunked
impl CategoricalChunked
pub fn full_null(name: &str, length: usize) -> CategoricalChunked
source§impl CategoricalChunked
impl CategoricalChunked
pub fn unique(&self) -> PolarsResult<Self>
pub fn n_unique(&self) -> PolarsResult<usize>
pub fn value_counts(&self) -> PolarsResult<DataFrame>
source§impl CategoricalChunked
impl CategoricalChunked
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn name(&self) -> &str
sourcepub fn logical(&self) -> &UInt32Chunked
pub fn logical(&self) -> &UInt32Chunked
Get a reference to the logical array (the categories).
pub fn set_lexical_sorted(&mut self, toggle: bool)
sourcepub unsafe fn from_cats_and_rev_map_unchecked(
idx: UInt32Chunked,
rev_map: Arc<RevMapping>
) -> Self
pub unsafe fn from_cats_and_rev_map_unchecked(
idx: UInt32Chunked,
rev_map: Arc<RevMapping>
) -> Self
Create a CategoricalChunked
from an array of idx
and an existing RevMapping
: rev_map
.
Safety
Invariant in v < rev_map.len() for v in idx
must be hold.
sourcepub fn get_rev_map(&self) -> &Arc<RevMapping>
pub fn get_rev_map(&self) -> &Arc<RevMapping>
Get a reference to the mapping of categorical types to the string values.
Trait Implementations§
source§impl Clone for CategoricalChunked
impl Clone for CategoricalChunked
source§fn clone(&self) -> CategoricalChunked
fn clone(&self) -> CategoricalChunked
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 From<&CategoricalChunked> for DictionaryArray<i64>
impl From<&CategoricalChunked> for DictionaryArray<i64>
source§fn from(ca: &CategoricalChunked) -> Self
fn from(ca: &CategoricalChunked) -> Self
Converts to this type from the input type.
source§impl From<&CategoricalChunked> for DictionaryArray<u32>
impl From<&CategoricalChunked> for DictionaryArray<u32>
source§fn from(ca: &CategoricalChunked) -> Self
fn from(ca: &CategoricalChunked) -> Self
Converts to this type from the input type.
source§impl IntoSeries for CategoricalChunked
impl IntoSeries for CategoricalChunked
source§impl LogicalType for CategoricalChunked
impl LogicalType for CategoricalChunked
source§fn get_any_value(&self, i: usize) -> PolarsResult<AnyValue<'_>>
fn get_any_value(&self, i: usize) -> PolarsResult<AnyValue<'_>>
Gets AnyValue from LogicalType