Trait polars_core::chunked_array::ops::ChunkUnique
source · pub trait ChunkUnique<T: PolarsDataType> {
fn unique(&self) -> PolarsResult<ChunkedArray<T>>;
fn arg_unique(&self) -> PolarsResult<IdxCa>;
fn n_unique(&self) -> PolarsResult<usize> { ... }
fn is_unique(&self) -> PolarsResult<BooleanChunked> { ... }
fn is_duplicated(&self) -> PolarsResult<BooleanChunked> { ... }
fn mode(&self) -> PolarsResult<ChunkedArray<T>> { ... }
}Expand description
Get unique values in a ChunkedArray
Required Methods§
sourcefn unique(&self) -> PolarsResult<ChunkedArray<T>>
fn unique(&self) -> PolarsResult<ChunkedArray<T>>
Get unique values of a ChunkedArray
sourcefn arg_unique(&self) -> PolarsResult<IdxCa>
fn arg_unique(&self) -> PolarsResult<IdxCa>
Get first index of the unique values in a ChunkedArray.
This Vec is sorted.
Provided Methods§
sourcefn n_unique(&self) -> PolarsResult<usize>
fn n_unique(&self) -> PolarsResult<usize>
Number of unique values in the ChunkedArray
Examples found in repository?
More examples
sourcefn is_unique(&self) -> PolarsResult<BooleanChunked>
fn is_unique(&self) -> PolarsResult<BooleanChunked>
Get a mask of all the unique values.
Examples found in repository?
More examples
src/chunked_array/ops/unique/mod.rs (line 400)
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420
fn is_unique(&self) -> PolarsResult<BooleanChunked> {
self.bit_repr_small().is_unique()
}
fn is_duplicated(&self) -> PolarsResult<BooleanChunked> {
self.bit_repr_small().is_duplicated()
}
}
impl ChunkUnique<Float64Type> for Float64Chunked {
fn unique(&self) -> PolarsResult<ChunkedArray<Float64Type>> {
let ca = self.bit_repr_large();
let ca = ca.unique()?;
Ok(ca._reinterpret_float())
}
fn arg_unique(&self) -> PolarsResult<IdxCa> {
self.bit_repr_large().arg_unique()
}
fn is_unique(&self) -> PolarsResult<BooleanChunked> {
self.bit_repr_large().is_unique()
}sourcefn is_duplicated(&self) -> PolarsResult<BooleanChunked>
fn is_duplicated(&self) -> PolarsResult<BooleanChunked>
Get a mask of all the duplicated values.
Examples found in repository?
More examples
src/chunked_array/ops/unique/mod.rs (line 403)
402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423
fn is_duplicated(&self) -> PolarsResult<BooleanChunked> {
self.bit_repr_small().is_duplicated()
}
}
impl ChunkUnique<Float64Type> for Float64Chunked {
fn unique(&self) -> PolarsResult<ChunkedArray<Float64Type>> {
let ca = self.bit_repr_large();
let ca = ca.unique()?;
Ok(ca._reinterpret_float())
}
fn arg_unique(&self) -> PolarsResult<IdxCa> {
self.bit_repr_large().arg_unique()
}
fn is_unique(&self) -> PolarsResult<BooleanChunked> {
self.bit_repr_large().is_unique()
}
fn is_duplicated(&self) -> PolarsResult<BooleanChunked> {
self.bit_repr_large().is_duplicated()
}sourcefn mode(&self) -> PolarsResult<ChunkedArray<T>>
fn mode(&self) -> PolarsResult<ChunkedArray<T>>
Available on crate feature
mode only.The most occurring value(s). Can return multiple Values