Trait polars_core::chunked_array::ops::ChunkCompare

source ·
pub trait ChunkCompare<Rhs> {
    type Item;

    // Required methods
    fn equal(&self, rhs: Rhs) -> Self::Item;
    fn equal_missing(&self, rhs: Rhs) -> Self::Item;
    fn not_equal(&self, rhs: Rhs) -> Self::Item;
    fn not_equal_missing(&self, rhs: Rhs) -> Self::Item;
    fn gt(&self, rhs: Rhs) -> Self::Item;
    fn gt_eq(&self, rhs: Rhs) -> Self::Item;
    fn lt(&self, rhs: Rhs) -> Self::Item;
    fn lt_eq(&self, rhs: Rhs) -> Self::Item;
}
Expand description

Compare Series and ChunkedArray’s and get a boolean mask that can be used to filter rows.

§Example

use polars_core::prelude::*;
fn filter_all_ones(df: &DataFrame) -> PolarsResult<DataFrame> {
    let mask = df
    .column("column_a")?
    .equal(1)?;

    df.filter(&mask)
}

Required Associated Types§

Required Methods§

source

fn equal(&self, rhs: Rhs) -> Self::Item

Check for equality.

source

fn equal_missing(&self, rhs: Rhs) -> Self::Item

Check for equality where None == None.

source

fn not_equal(&self, rhs: Rhs) -> Self::Item

Check for inequality.

source

fn not_equal_missing(&self, rhs: Rhs) -> Self::Item

Check for inequality where None == None.

source

fn gt(&self, rhs: Rhs) -> Self::Item

Greater than comparison.

source

fn gt_eq(&self, rhs: Rhs) -> Self::Item

Greater than or equal comparison.

source

fn lt(&self, rhs: Rhs) -> Self::Item

Less than comparison.

source

fn lt_eq(&self, rhs: Rhs) -> Self::Item

Less than or equal comparison

Implementors§

source§

impl ChunkCompare<&str> for CategoricalChunked

Available on crate feature dtype-categorical only.
source§

impl ChunkCompare<&str> for Series

source§

impl ChunkCompare<&str> for StringChunked

source§

impl ChunkCompare<&CategoricalChunked> for CategoricalChunked

Available on crate feature dtype-categorical only.
source§

impl ChunkCompare<&Series> for Series

source§

impl ChunkCompare<&ChunkedArray<BinaryType>> for BinaryChunked

source§

impl ChunkCompare<&ChunkedArray<BooleanType>> for BooleanChunked

source§

impl ChunkCompare<&ChunkedArray<ListType>> for ListChunked

source§

impl ChunkCompare<&ChunkedArray<StringType>> for CategoricalChunked

Available on crate feature dtype-categorical only.
source§

impl ChunkCompare<&ChunkedArray<StringType>> for StringChunked

source§

impl ChunkCompare<&[u8]> for BinaryChunked

source§

impl<Rhs> ChunkCompare<Rhs> for Series
where Rhs: NumericNative,

source§

impl<T> ChunkCompare<&ChunkedArray<T>> for ChunkedArray<T>
where T: PolarsNumericType, T::Array: TotalOrdKernel<Scalar = T::Native>,

source§

impl<T, Rhs> ChunkCompare<Rhs> for ChunkedArray<T>
where T: PolarsNumericType, Rhs: ToPrimitive, T::Array: TotalOrdKernel<Scalar = T::Native>,