Skip to main content

ChunkUnique

Trait ChunkUnique 

Source
pub trait ChunkUnique {
    // Required methods
    fn unique(&self) -> PolarsResult<Self>
       where Self: Sized;
    fn arg_unique(&self) -> PolarsResult<IdxCa>;
    fn unique_id(&self) -> PolarsResult<(IdxSize, Vec<IdxSize>)>;

    // Provided method
    fn n_unique(&self) -> PolarsResult<usize> { ... }
}
Expand description

Get unique values in a ChunkedArray

Required Methods§

Source

fn unique(&self) -> PolarsResult<Self>
where Self: Sized,

Get unique values of a ChunkedArray

Source

fn arg_unique(&self) -> PolarsResult<IdxCa>

Get first index of the unique values in a ChunkedArray. This Vec is sorted.

Source

fn unique_id(&self) -> PolarsResult<(IdxSize, Vec<IdxSize>)>

Get dense ids for each unique value.

Returns: (n_unique, unique_ids)

Provided Methods§

Source

fn n_unique(&self) -> PolarsResult<usize>

Number of unique values in the ChunkedArray

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl ChunkUnique for BinaryChunked

Available on crate feature algorithm_group_by only.
Source§

impl ChunkUnique for BinaryOffsetChunked

Available on crate feature algorithm_group_by only.
Source§

impl ChunkUnique for BooleanChunked

Available on crate feature algorithm_group_by only.
Source§

impl ChunkUnique for StringChunked

Available on crate feature algorithm_group_by only.
Source§

impl<T: PolarsObject> ChunkUnique for ObjectChunked<T>

Available on crate features algorithm_group_by and object only.
Source§

impl<T> ChunkUnique for ChunkedArray<T>

Available on crate feature algorithm_group_by only.