Trait polars::chunked_array::ops::ChunkCompare
source · [−]pub trait ChunkCompare<Rhs> {
fn eq_missing(&self, rhs: Rhs) -> ChunkedArray<BooleanType>;
fn equal(&self, rhs: Rhs) -> ChunkedArray<BooleanType>;
fn not_equal(&self, rhs: Rhs) -> ChunkedArray<BooleanType>;
fn gt(&self, rhs: Rhs) -> ChunkedArray<BooleanType>;
fn gt_eq(&self, rhs: Rhs) -> ChunkedArray<BooleanType>;
fn lt(&self, rhs: Rhs) -> ChunkedArray<BooleanType>;
fn lt_eq(&self, rhs: Rhs) -> ChunkedArray<BooleanType>;
}
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) -> Result<DataFrame> {
let mask = df
.column("column_a")?
.equal(1);
df.filter(&mask)
}
Required methods
fn eq_missing(&self, rhs: Rhs) -> ChunkedArray<BooleanType>
fn eq_missing(&self, rhs: Rhs) -> ChunkedArray<BooleanType>
Check for equality and regard missing values as equal.
fn equal(&self, rhs: Rhs) -> ChunkedArray<BooleanType>
fn equal(&self, rhs: Rhs) -> ChunkedArray<BooleanType>
Check for equality.
fn not_equal(&self, rhs: Rhs) -> ChunkedArray<BooleanType>
fn not_equal(&self, rhs: Rhs) -> ChunkedArray<BooleanType>
Check for inequality.
fn gt(&self, rhs: Rhs) -> ChunkedArray<BooleanType>
fn gt(&self, rhs: Rhs) -> ChunkedArray<BooleanType>
Greater than comparison.
fn gt_eq(&self, rhs: Rhs) -> ChunkedArray<BooleanType>
fn gt_eq(&self, rhs: Rhs) -> ChunkedArray<BooleanType>
Greater than or equal comparison.
fn lt(&self, rhs: Rhs) -> ChunkedArray<BooleanType>
fn lt(&self, rhs: Rhs) -> ChunkedArray<BooleanType>
Less than comparison.
fn lt_eq(&self, rhs: Rhs) -> ChunkedArray<BooleanType>
fn lt_eq(&self, rhs: Rhs) -> ChunkedArray<BooleanType>
Less than or equal comparison