Struct polars::prelude::CategoricalChunked
source · pub struct CategoricalChunked { /* private fields */ }
Implementations§
source§impl CategoricalChunked
impl CategoricalChunked
pub fn sort_with(&self, options: SortOptions) -> CategoricalChunked
Available on crate feature
dtype-categorical
only.sourcepub fn sort(&self, descending: bool) -> CategoricalChunked
Available on crate feature dtype-categorical
only.
pub fn sort(&self, descending: bool) -> CategoricalChunked
dtype-categorical
only.Returned a sorted ChunkedArray
.
sourcepub fn arg_sort(&self, options: SortOptions) -> ChunkedArray<UInt32Type>
Available on crate feature dtype-categorical
only.
pub fn arg_sort(&self, options: SortOptions) -> ChunkedArray<UInt32Type>
dtype-categorical
only.Retrieve the indexes needed to sort this array.
source§impl CategoricalChunked
impl CategoricalChunked
sourcepub unsafe fn from_global_indices_unchecked(
cats: ChunkedArray<UInt32Type>
) -> CategoricalChunked
Available on crate feature dtype-categorical
only.
pub unsafe fn from_global_indices_unchecked( cats: ChunkedArray<UInt32Type> ) -> CategoricalChunked
dtype-categorical
only.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: &CategoricalChunked) -> Result<(), PolarsError>
Available on crate feature
dtype-categorical
only.source§impl CategoricalChunked
impl CategoricalChunked
pub fn full_null(name: &str, length: usize) -> CategoricalChunked
Available on crate feature
dtype-categorical
only.source§impl CategoricalChunked
impl CategoricalChunked
pub fn unique(&self) -> Result<CategoricalChunked, PolarsError>
Available on crate feature
dtype-categorical
only.pub fn n_unique(&self) -> Result<usize, PolarsError>
Available on crate feature
dtype-categorical
only.pub fn value_counts(&self) -> Result<DataFrame, PolarsError>
Available on crate feature
dtype-categorical
only.source§impl CategoricalChunked
impl CategoricalChunked
pub fn is_empty(&self) -> bool
Available on crate feature
dtype-categorical
only.pub fn len(&self) -> usize
Available on crate feature
dtype-categorical
only.pub fn null_count(&self) -> usize
Available on crate feature
dtype-categorical
only.pub fn name(&self) -> &str
Available on crate feature
dtype-categorical
only.sourcepub fn physical(&self) -> &ChunkedArray<UInt32Type>
Available on crate feature dtype-categorical
only.
pub fn physical(&self) -> &ChunkedArray<UInt32Type>
dtype-categorical
only.Get a reference to the physical array (the categories).
sourcepub fn to_local(&self) -> CategoricalChunked
Available on crate feature dtype-categorical
only.
pub fn to_local(&self) -> CategoricalChunked
dtype-categorical
only.Convert a categorical column to its local representation.
pub fn set_lexical_ordering(&mut self, toggle: bool)
Available on crate feature
dtype-categorical
only.sourcepub fn uses_lexical_ordering(&self) -> bool
Available on crate feature dtype-categorical
only.
pub fn uses_lexical_ordering(&self) -> bool
dtype-categorical
only.Return whether or not the CategoricalChunked
uses the lexical order
of the string values when sorting.
sourcepub unsafe fn from_cats_and_rev_map_unchecked(
idx: ChunkedArray<UInt32Type>,
rev_map: Arc<RevMapping>
) -> CategoricalChunked
Available on crate feature dtype-categorical
only.
pub unsafe fn from_cats_and_rev_map_unchecked( idx: ChunkedArray<UInt32Type>, rev_map: Arc<RevMapping> ) -> CategoricalChunked
dtype-categorical
only.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 hold.
sourcepub fn get_rev_map(&self) -> &Arc<RevMapping>
Available on crate feature dtype-categorical
only.
pub fn get_rev_map(&self) -> &Arc<RevMapping>
dtype-categorical
only.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) -> DictionaryArray<i64>
fn from(ca: &CategoricalChunked) -> DictionaryArray<i64>
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) -> DictionaryArray<u32>
fn from(ca: &CategoricalChunked) -> DictionaryArray<u32>
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 dtype(&self) -> &DataType
fn dtype(&self) -> &DataType
Get data type of
ChunkedArray
.source§fn get_any_value(&self, i: usize) -> Result<AnyValue<'_>, PolarsError>
fn get_any_value(&self, i: usize) -> Result<AnyValue<'_>, PolarsError>
Gets
AnyValue
from LogicalType
fn cast(&self, dtype: &DataType) -> Result<Series, PolarsError>
Auto Trait Implementations§
impl !RefUnwindSafe for CategoricalChunked
impl Send for CategoricalChunked
impl Sync for CategoricalChunked
impl Unpin for CategoricalChunked
impl !UnwindSafe for CategoricalChunked
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