polars::prelude

Trait ChunkCompareEq

Source
pub trait ChunkCompareEq<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;
}
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")?
    .as_materialized_series()
    .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.

Implementors§

Source§

impl ChunkCompareEq<&Column> for Column

Source§

impl ChunkCompareEq<&str> for ChunkedArray<StringType>

Source§

impl ChunkCompareEq<&str> for CategoricalChunked

Source§

impl ChunkCompareEq<&str> for Series

Source§

impl ChunkCompareEq<&ChunkedArray<BinaryType>> for ChunkedArray<BinaryType>

Source§

impl ChunkCompareEq<&ChunkedArray<BooleanType>> for ChunkedArray<BooleanType>

Source§

impl ChunkCompareEq<&ChunkedArray<FixedSizeListType>> for ChunkedArray<FixedSizeListType>

Available on crate feature dtype-array only.
Source§

impl ChunkCompareEq<&ChunkedArray<ListType>> for ChunkedArray<ListType>

Source§

impl ChunkCompareEq<&ChunkedArray<StringType>> for ChunkedArray<StringType>

Source§

impl ChunkCompareEq<&ChunkedArray<StringType>> for CategoricalChunked

Source§

impl ChunkCompareEq<&ChunkedArray<StructType>> for ChunkedArray<StructType>

Available on crate feature dtype-struct only.
Source§

impl ChunkCompareEq<&CategoricalChunked> for CategoricalChunked

Source§

impl ChunkCompareEq<&Series> for Series

Source§

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

Source§

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

Source§

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

Source§

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