Trait polars::prelude::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§
sourcefn equal_missing(&self, rhs: Rhs) -> Self::Item
fn equal_missing(&self, rhs: Rhs) -> Self::Item
Check for equality where None == None
.
sourcefn not_equal_missing(&self, rhs: Rhs) -> Self::Item
fn not_equal_missing(&self, rhs: Rhs) -> Self::Item
Check for inequality where None == None
.
Implementors§
source§impl ChunkCompare<&str> for ChunkedArray<StringType>
impl ChunkCompare<&str> for ChunkedArray<StringType>
type Item = ChunkedArray<BooleanType>
source§impl ChunkCompare<&str> for CategoricalChunked
impl ChunkCompare<&str> for CategoricalChunked
type Item = Result<ChunkedArray<BooleanType>, PolarsError>
source§impl ChunkCompare<&str> for Series
impl ChunkCompare<&str> for Series
type Item = Result<ChunkedArray<BooleanType>, PolarsError>
source§impl ChunkCompare<&ChunkedArray<BinaryType>> for ChunkedArray<BinaryType>
impl ChunkCompare<&ChunkedArray<BinaryType>> for ChunkedArray<BinaryType>
type Item = ChunkedArray<BooleanType>
source§impl ChunkCompare<&ChunkedArray<BooleanType>> for ChunkedArray<BooleanType>
impl ChunkCompare<&ChunkedArray<BooleanType>> for ChunkedArray<BooleanType>
type Item = ChunkedArray<BooleanType>
source§impl ChunkCompare<&ChunkedArray<FixedSizeListType>> for ChunkedArray<FixedSizeListType>
Available on crate feature dtype-array
only.
impl ChunkCompare<&ChunkedArray<FixedSizeListType>> for ChunkedArray<FixedSizeListType>
Available on crate feature
dtype-array
only.type Item = ChunkedArray<BooleanType>
source§impl ChunkCompare<&ChunkedArray<ListType>> for ChunkedArray<ListType>
impl ChunkCompare<&ChunkedArray<ListType>> for ChunkedArray<ListType>
type Item = ChunkedArray<BooleanType>
source§impl ChunkCompare<&ChunkedArray<StringType>> for ChunkedArray<StringType>
impl ChunkCompare<&ChunkedArray<StringType>> for ChunkedArray<StringType>
type Item = ChunkedArray<BooleanType>
source§impl ChunkCompare<&ChunkedArray<StringType>> for CategoricalChunked
impl ChunkCompare<&ChunkedArray<StringType>> for CategoricalChunked
type Item = Result<ChunkedArray<BooleanType>, PolarsError>
source§impl ChunkCompare<&CategoricalChunked> for CategoricalChunked
impl ChunkCompare<&CategoricalChunked> for CategoricalChunked
type Item = Result<ChunkedArray<BooleanType>, PolarsError>
source§impl ChunkCompare<&StructChunked> for StructChunked
Available on crate feature dtype-struct
only.
impl ChunkCompare<&StructChunked> for StructChunked
Available on crate feature
dtype-struct
only.