pub type BooleanChunked = ChunkedArray<BooleanType>;

Aliased Type§

struct BooleanChunked { /* private fields */ }

Implementations§

source§

impl BooleanChunked

Booleans are casted to 1 or 0.

source

pub fn sum(&self) -> Option<IdxSize>

source

pub fn min(&self) -> Option<bool>

source

pub fn max(&self) -> Option<bool>

source

pub fn mean(&self) -> Option<f64>

source§

impl BooleanChunked

source

pub fn any(&self) -> bool

Returns whether any of the values in the column are true.

Null values are ignored.

source

pub fn all(&self) -> bool

Returns whether all values in the array are true.

Null values are ignored.

source

pub fn any_kleene(&self) -> Option<bool>

Returns whether any of the values in the column are true.

The output is unknown (None) if the array contains any null values and no true values.

source

pub fn all_kleene(&self) -> Option<bool>

Returns whether all values in the column are true.

The output is unknown (None) if the array contains any null values and no false values.

source§

impl BooleanChunked

source

pub unsafe fn mmap_slice( name: &str, values: &[u8], offset: usize, len: usize ) -> Self

Create a temporary ChunkedArray from a slice.

§Safety

The lifetime will be bound to the lifetime of the slice. This will not be checked by the borrowchecker.

source§

impl BooleanChunked

source

pub fn rand_bernoulli(name: &str, length: usize, p: f64) -> PolarsResult<Self>

Available on crate feature random only.

Create ChunkedArray with samples from a Bernoulli distribution.

Trait Implementations§

source§

impl Add for &BooleanChunked

§

type Output = ChunkedArray<UInt32Type>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
source§

impl Add for BooleanChunked

§

type Output = ChunkedArray<UInt32Type>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
source§

impl AggList for BooleanChunked

Available on crate feature algorithm_group_by only.
source§

unsafe fn agg_list(&self, groups: &GroupsProxy) -> Series

Safety Read more
source§

impl BitAnd for &BooleanChunked

§

type Output = ChunkedArray<BooleanType>

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: Self) -> Self::Output

Performs the & operation. Read more
source§

impl BitAnd for BooleanChunked

§

type Output = ChunkedArray<BooleanType>

The resulting type after applying the & operator.
source§

fn bitand(self, rhs: Self) -> Self::Output

Performs the & operation. Read more
source§

impl BitOr for &BooleanChunked

§

type Output = ChunkedArray<BooleanType>

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
source§

impl BitOr for BooleanChunked

§

type Output = ChunkedArray<BooleanType>

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
source§

impl BitXor for &BooleanChunked

§

type Output = ChunkedArray<BooleanType>

The resulting type after applying the ^ operator.
source§

fn bitxor(self, rhs: Self) -> Self::Output

Performs the ^ operation. Read more
source§

impl BitXor for BooleanChunked

§

type Output = ChunkedArray<BooleanType>

The resulting type after applying the ^ operator.
source§

fn bitxor(self, rhs: Self) -> Self::Output

Performs the ^ operation. Read more
source§

impl ChunkAggSeries for BooleanChunked

source§

fn sum_as_series(&self) -> Series

Get the sum of the ChunkedArray as a new Series of length 1.
source§

fn max_as_series(&self) -> Series

Get the max of the ChunkedArray as a new Series of length 1.
source§

fn min_as_series(&self) -> Series

Get the min of the ChunkedArray as a new Series of length 1.
source§

fn prod_as_series(&self) -> Series

Get the product of the ChunkedArray as a new Series of length 1.
source§

impl ChunkAnyValue for BooleanChunked

source§

unsafe fn get_any_value_unchecked(&self, index: usize) -> AnyValue<'_>

Get a single value. Beware this is slow. If you need to use this slightly performant, cast Categorical to UInt32 Read more
source§

fn get_any_value(&self, index: usize) -> PolarsResult<AnyValue<'_>>

Get a single value. Beware this is slow.
source§

impl<'a> ChunkApply<'a, bool> for BooleanChunked

§

type FuncRet = bool

source§

fn apply_values<F>(&self, f: F) -> Self
where F: Fn(bool) -> bool + Copy,

Apply a closure elementwise. This is fastest when the null check branching is more expensive than the closure application. Often it is. Read more
source§

fn try_apply<F>(&self, f: F) -> PolarsResult<Self>
where F: Fn(bool) -> PolarsResult<bool> + Copy,

source§

fn apply<F>(&'a self, f: F) -> Self
where F: Fn(Option<bool>) -> Option<bool> + Copy,

Apply a closure elementwise including null values.
source§

fn apply_to_slice<F, T>(&'a self, f: F, slice: &mut [T])
where F: Fn(Option<bool>, &T) -> T,

Apply a closure elementwise and write results to a mutable slice.
source§

impl ChunkApplyKernel<BooleanArray> for BooleanChunked

source§

fn apply_kernel(&self, f: &dyn Fn(&BooleanArray) -> ArrayRef) -> Self

Apply kernel and return result as a new ChunkedArray.
source§

fn apply_kernel_cast<S>( &self, f: &dyn Fn(&BooleanArray) -> ArrayRef ) -> ChunkedArray<S>
where S: PolarsDataType,

Apply a kernel that outputs an array of different type.
source§

impl ChunkCast for BooleanChunked

source§

fn cast(&self, data_type: &DataType) -> PolarsResult<Series>

source§

unsafe fn cast_unchecked(&self, data_type: &DataType) -> PolarsResult<Series>

Does not check if the cast is a valid one and may over/underflow Read more
source§

impl ChunkCompare<&ChunkedArray<BooleanType>> for BooleanChunked

§

type Item = ChunkedArray<BooleanType>

source§

fn equal(&self, rhs: &BooleanChunked) -> BooleanChunked

Check for equality.
source§

fn equal_missing(&self, rhs: &BooleanChunked) -> BooleanChunked

Check for equality where None == None.
source§

fn not_equal(&self, rhs: &BooleanChunked) -> BooleanChunked

Check for inequality.
source§

fn not_equal_missing(&self, rhs: &BooleanChunked) -> BooleanChunked

Check for inequality where None == None.
source§

fn lt(&self, rhs: &BooleanChunked) -> BooleanChunked

Less than comparison.
source§

fn lt_eq(&self, rhs: &BooleanChunked) -> BooleanChunked

Less than or equal comparison
source§

fn gt(&self, rhs: &Self) -> BooleanChunked

Greater than comparison.
source§

fn gt_eq(&self, rhs: &Self) -> BooleanChunked

Greater than or equal comparison.
source§

impl ChunkExpandAtIndex<BooleanType> for BooleanChunked

source§

fn new_from_index(&self, index: usize, length: usize) -> BooleanChunked

Create a new ChunkedArray filled with values at that index.
source§

impl ChunkFillNullValue<bool> for BooleanChunked

source§

fn fill_null_with_values(&self, value: bool) -> PolarsResult<Self>

Replace None values with a give value T.
source§

impl ChunkFilter<BooleanType> for BooleanChunked

source§

fn filter( &self, filter: &BooleanChunked ) -> PolarsResult<ChunkedArray<BooleanType>>

Filter values in the ChunkedArray with a boolean mask. Read more
source§

impl ChunkFull<bool> for BooleanChunked

source§

fn full(name: &str, value: bool, length: usize) -> Self

Create a ChunkedArray with a single value.
source§

impl ChunkFullNull for BooleanChunked

source§

fn full_null(name: &str, length: usize) -> Self

source§

impl ChunkQuantile<bool> for BooleanChunked

source§

fn median(&self) -> Option<T>

Returns the mean value in the array. Returns None if the array is empty or only contains null values.
source§

fn quantile( &self, _quantile: f64, _interpol: QuantileInterpolOptions ) -> PolarsResult<Option<T>>

Aggregate a given quantile of the ChunkedArray. Returns None if the array is empty or only contains null values.
source§

impl ChunkReverse for BooleanChunked

source§

fn reverse(&self) -> Self

Return a reversed version of this array.
source§

impl<'a> ChunkSet<'a, bool, bool> for BooleanChunked

source§

fn scatter_single<I: IntoIterator<Item = IdxSize>>( &'a self, idx: I, value: Option<bool> ) -> PolarsResult<Self>

Set the values at indexes idx to some optional value Option<T>. Read more
source§

fn scatter_with<I: IntoIterator<Item = IdxSize>, F>( &'a self, idx: I, f: F ) -> PolarsResult<Self>
where F: Fn(Option<bool>) -> Option<bool>,

Set the values at indexes idx by applying a closure to these values. Read more
source§

fn set( &'a self, mask: &BooleanChunked, value: Option<bool> ) -> PolarsResult<Self>

Set the values where the mask evaluates to true to some optional value Option<T>. Read more
source§

impl ChunkShift<BooleanType> for BooleanChunked

source§

fn shift(&self, periods: i64) -> Self

source§

impl ChunkShiftFill<BooleanType, Option<bool>> for BooleanChunked

source§

fn shift_and_fill( &self, periods: i64, fill_value: Option<bool> ) -> BooleanChunked

Shift the values by a given period and fill the parts that will be empty due to this operation with fill_value.
source§

impl ChunkSort<BooleanType> for BooleanChunked

source§

fn sort_with(&self, options: SortOptions) -> ChunkedArray<BooleanType>

source§

fn sort(&self, descending: bool) -> BooleanChunked

Returned a sorted ChunkedArray.
source§

fn arg_sort(&self, options: SortOptions) -> IdxCa

Retrieve the indexes needed to sort this array.
source§

fn arg_sort_multiple( &self, options: &SortMultipleOptions ) -> PolarsResult<IdxCa>

Retrieve the indexes need to sort this and the other arrays.
source§

impl ChunkUnique<BooleanType> for BooleanChunked

Available on crate feature algorithm_group_by only.
source§

fn unique(&self) -> PolarsResult<Self>

Get unique values of a ChunkedArray
source§

fn arg_unique(&self) -> PolarsResult<IdxCa>

Get first index of the unique values in a ChunkedArray. This Vec is sorted.
source§

fn n_unique(&self) -> PolarsResult<usize>

Number of unique values in the ChunkedArray
source§

impl ChunkVar for BooleanChunked

source§

fn var(&self, _ddof: u8) -> Option<f64>

Compute the variance of this ChunkedArray/Series.
source§

fn std(&self, _ddof: u8) -> Option<f64>

Compute the standard deviation of this ChunkedArray/Series.
source§

impl ChunkZip<BooleanType> for BooleanChunked

Available on crate feature zip_with only.
source§

fn zip_with( &self, mask: &BooleanChunked, other: &BooleanChunked ) -> PolarsResult<BooleanChunked>

Create a new ChunkedArray with values from self where the mask evaluates true and values from other where the mask evaluates false
source§

impl FromIterator<bool> for BooleanChunked

source§

fn from_iter<I: IntoIterator<Item = bool>>(iter: I) -> Self

Creates a value from an iterator. Read more
source§

impl FromIteratorReversed<Option<bool>> for BooleanChunked

source§

fn from_trusted_len_iter_rev<I: TrustedLen<Item = Option<bool>>>( iter: I ) -> Self

source§

impl FromParallelIterator<Option<bool>> for BooleanChunked

source§

fn from_par_iter<I: IntoParallelIterator<Item = Option<bool>>>(iter: I) -> Self

Creates an instance of the collection from the parallel iterator par_iter. Read more
source§

impl FromParallelIterator<bool> for BooleanChunked

source§

fn from_par_iter<I: IntoParallelIterator<Item = bool>>(iter: I) -> Self

Creates an instance of the collection from the parallel iterator par_iter. Read more
source§

impl FromTrustedLenIterator<bool> for BooleanChunked

source§

fn from_iter_trusted_length<I: IntoIterator<Item = bool>>(iter: I) -> Self
where I::IntoIter: TrustedLen,

source§

impl IntoGroupsProxy for BooleanChunked

Available on crate feature algorithm_group_by only.
source§

fn group_tuples( &self, multithreaded: bool, sorted: bool ) -> PolarsResult<GroupsProxy>

Create the tuples need for a group_by operation. * The first value in the tuple is the first index of the group. * The second value in the tuple is are the indexes of the groups including the first value.
source§

impl<'a> IntoIterator for &'a BooleanChunked

§

type Item = Option<bool>

The type of the elements being iterated over.
§

type IntoIter = Box<dyn PolarsIterator<Item = <&'a ChunkedArray<BooleanType> as IntoIterator>::Item> + 'a>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl NewChunkedArray<BooleanType, bool> for BooleanChunked

source§

fn from_iter_values( name: &str, it: impl Iterator<Item = bool> ) -> ChunkedArray<BooleanType>

Create a new ChunkedArray from an iterator.

source§

fn from_slice(name: &str, v: &[bool]) -> Self

source§

fn from_slice_options(name: &str, opt_v: &[Option<bool>]) -> Self

source§

fn from_iter_options( name: &str, it: impl Iterator<Item = Option<bool>> ) -> ChunkedArray<BooleanType>

Create a new ChunkedArray from an iterator.
source§

impl Not for &BooleanChunked

§

type Output = ChunkedArray<BooleanType>

The resulting type after applying the ! operator.
source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
source§

impl Not for BooleanChunked

§

type Output = ChunkedArray<BooleanType>

The resulting type after applying the ! operator.
source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
source§

impl VecHash for BooleanChunked

source§

fn vec_hash( &self, random_state: RandomState, buf: &mut Vec<u64> ) -> PolarsResult<()>

Compute the hash for all values in the array. Read more
source§

fn vec_hash_combine( &self, random_state: RandomState, hashes: &mut [u64] ) -> PolarsResult<()>