Trait polars_core::chunked_array::ops::ChunkCompare
source · pub trait ChunkCompare<Rhs> {
type 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) -> PolarsResult<DataFrame> {
let mask = df
.column("column_a")?
.equal(1)?;
df.filter(&mask)
}
Required Associated Types§
Required Methods§
Implementors§
source§impl ChunkCompare<&str> for Series
impl ChunkCompare<&str> for Series
type Item = Result<ChunkedArray<BooleanType>, PolarsError>
source§impl ChunkCompare<&str> for Utf8Chunked
impl ChunkCompare<&str> for Utf8Chunked
type Item = ChunkedArray<BooleanType>
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.type Item = ChunkedArray<BooleanType>
source§impl ChunkCompare<&Series> for Series
impl ChunkCompare<&Series> for Series
type Item = Result<ChunkedArray<BooleanType>, PolarsError>
source§impl ChunkCompare<&ChunkedArray<BinaryType>> for BinaryChunked
Available on crate feature dtype-binary
only.
impl ChunkCompare<&ChunkedArray<BinaryType>> for BinaryChunked
Available on crate feature
dtype-binary
only.type Item = ChunkedArray<BooleanType>
source§impl ChunkCompare<&ChunkedArray<BooleanType>> for BooleanChunked
impl ChunkCompare<&ChunkedArray<BooleanType>> for BooleanChunked
type Item = ChunkedArray<BooleanType>
source§impl ChunkCompare<&ChunkedArray<ListType>> for ListChunked
impl ChunkCompare<&ChunkedArray<ListType>> for ListChunked
type Item = ChunkedArray<BooleanType>
source§impl ChunkCompare<&ChunkedArray<Utf8Type>> for Utf8Chunked
impl ChunkCompare<&ChunkedArray<Utf8Type>> for Utf8Chunked
type Item = ChunkedArray<BooleanType>
source§impl ChunkCompare<&[u8]> for BinaryChunked
Available on crate feature dtype-binary
only.
impl ChunkCompare<&[u8]> for BinaryChunked
Available on crate feature
dtype-binary
only.