pub struct CategoricalChunked { /* private fields */ }

Implementations§

source§

impl CategoricalChunked

source

pub fn sort_with(&self, options: SortOptions) -> CategoricalChunked

Available on crate feature dtype-categorical only.
source

pub fn sort(&self, descending: bool) -> CategoricalChunked

Available on crate feature dtype-categorical only.

Returned a sorted ChunkedArray.

source

pub fn arg_sort(&self, options: SortOptions) -> ChunkedArray<UInt32Type>

Available on crate feature dtype-categorical only.

Retrieve the indexes needed to sort this array.

source§

impl CategoricalChunked

source

pub unsafe fn from_global_indices_unchecked( cats: ChunkedArray<UInt32Type> ) -> CategoricalChunked

Available on crate feature 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

source

pub fn append(&mut self, other: &CategoricalChunked) -> Result<(), PolarsError>

Available on crate feature dtype-categorical only.
source§

impl CategoricalChunked

source

pub fn full_null(name: &str, length: usize) -> CategoricalChunked

Available on crate feature dtype-categorical only.
source§

impl CategoricalChunked

source

pub fn unique(&self) -> Result<CategoricalChunked, PolarsError>

Available on crate feature dtype-categorical only.
source

pub fn n_unique(&self) -> Result<usize, PolarsError>

Available on crate feature dtype-categorical only.
source

pub fn value_counts(&self) -> Result<DataFrame, PolarsError>

Available on crate feature dtype-categorical only.
source§

impl CategoricalChunked

source

pub fn is_empty(&self) -> bool

Available on crate feature dtype-categorical only.
source

pub fn len(&self) -> usize

Available on crate feature dtype-categorical only.
source

pub fn null_count(&self) -> usize

Available on crate feature dtype-categorical only.
source

pub fn name(&self) -> &str

Available on crate feature dtype-categorical only.
source

pub fn physical(&self) -> &ChunkedArray<UInt32Type>

Available on crate feature dtype-categorical only.

Get a reference to the physical array (the categories).

source

pub fn to_local(&self) -> CategoricalChunked

Available on crate feature dtype-categorical only.

Convert a categorical column to its local representation.

source

pub fn set_lexical_ordering(&mut self, toggle: bool)

Available on crate feature dtype-categorical only.
source

pub fn uses_lexical_ordering(&self) -> bool

Available on crate feature dtype-categorical only.

Return whether or not the CategoricalChunked uses the lexical order of the string values when sorting.

source

pub unsafe fn from_cats_and_rev_map_unchecked( idx: ChunkedArray<UInt32Type>, rev_map: Arc<RevMapping> ) -> CategoricalChunked

Available on crate feature 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.

source

pub fn get_rev_map(&self) -> &Arc<RevMapping>

Available on crate feature dtype-categorical only.

Get a reference to the mapping of categorical types to the string values.

source

pub fn iter_str(&self) -> CatIter<'_>

Available on crate feature dtype-categorical only.

Create an [Iterator] that iterates over the &str values of the [CategoricalChunked].

Trait Implementations§

source§

impl Clone for CategoricalChunked

source§

fn clone(&self) -> CategoricalChunked

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<&CategoricalChunked> for DictionaryArray<i64>

source§

fn from(ca: &CategoricalChunked) -> DictionaryArray<i64>

Converts to this type from the input type.
source§

impl From<&CategoricalChunked> for DictionaryArray<u32>

source§

fn from(ca: &CategoricalChunked) -> DictionaryArray<u32>

Converts to this type from the input type.
source§

impl IntoSeries for CategoricalChunked

source§

impl LogicalType for CategoricalChunked

source§

fn dtype(&self) -> &DataType

Get data type of ChunkedArray.
source§

fn get_any_value(&self, i: usize) -> Result<AnyValue<'_>, PolarsError>

source§

unsafe fn get_any_value_unchecked(&self, i: usize) -> AnyValue<'_>

Safety Read more
source§

fn cast(&self, dtype: &DataType) -> Result<Series, PolarsError>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V