Trait polars_core::chunked_array::ops::ChunkCompare
source · [−]pub trait ChunkCompare<Rhs> {
type Item;
fn eq_missing(&self, rhs: Rhs) -> Self::Item;
fn equal(&self, rhs: Rhs) -> Self::Item;
fn not_equal(&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) -> Result<DataFrame> {
let mask = df
.column("column_a")?
.equal(1)?;
df.filter(&mask)
}
Required Associated Types
Required Methods
fn eq_missing(&self, rhs: Rhs) -> Self::Item
fn eq_missing(&self, rhs: Rhs) -> Self::Item
Check for equality and regard missing values as equal.