Trait polars::series::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 ChunkedArray<StringType>

source§

impl ChunkCompare<&str> for CategoricalChunked

source§

impl ChunkCompare<&str> for Series

source§

impl ChunkCompare<&ChunkedArray<BinaryType>> for ChunkedArray<BinaryType>

source§

impl ChunkCompare<&ChunkedArray<BooleanType>> for ChunkedArray<BooleanType>

source§

impl ChunkCompare<&ChunkedArray<FixedSizeListType>> for ChunkedArray<FixedSizeListType>

Available on crate feature dtype-array only.
source§

impl ChunkCompare<&ChunkedArray<ListType>> for ChunkedArray<ListType>

source§

impl ChunkCompare<&ChunkedArray<StringType>> for ChunkedArray<StringType>

source§

impl ChunkCompare<&ChunkedArray<StringType>> for CategoricalChunked

source§

impl ChunkCompare<&CategoricalChunked> for CategoricalChunked

source§

impl ChunkCompare<&StructChunked> for StructChunked

Available on crate feature dtype-struct only.
source§

impl ChunkCompare<&Series> for Series

source§

impl ChunkCompare<&[u8]> for ChunkedArray<BinaryType>

source§

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

source§

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

source§

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