Type Definition polars_core::datatypes::BooleanChunked
source · pub type BooleanChunked = ChunkedArray<BooleanType>;
Implementations§
source§impl BooleanChunked
impl BooleanChunked
sourcepub fn rand_bernoulli(name: &str, length: usize, p: f64) -> PolarsResult<Self>
Available on crate feature random
only.
pub fn rand_bernoulli(name: &str, length: usize, p: f64) -> PolarsResult<Self>
random
only.Create ChunkedArray
with samples from a Bernoulli distribution.
Trait Implementations§
source§impl AggList for BooleanChunked
impl AggList for BooleanChunked
source§impl ArgAgg for BooleanChunked
impl ArgAgg for BooleanChunked
source§impl BitAnd<&ChunkedArray<BooleanType>> for &BooleanChunked
impl BitAnd<&ChunkedArray<BooleanType>> for &BooleanChunked
§type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
The resulting type after applying the
&
operator.source§impl BitAnd<ChunkedArray<BooleanType>> for BooleanChunked
impl BitAnd<ChunkedArray<BooleanType>> for BooleanChunked
§type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
The resulting type after applying the
&
operator.source§impl BitOr<&ChunkedArray<BooleanType>> for &BooleanChunked
impl BitOr<&ChunkedArray<BooleanType>> for &BooleanChunked
§type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
The resulting type after applying the
|
operator.source§impl BitOr<ChunkedArray<BooleanType>> for BooleanChunked
impl BitOr<ChunkedArray<BooleanType>> for BooleanChunked
§type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
The resulting type after applying the
|
operator.source§impl BitXor<&ChunkedArray<BooleanType>> for &BooleanChunked
impl BitXor<&ChunkedArray<BooleanType>> for &BooleanChunked
§type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
The resulting type after applying the
^
operator.source§impl BitXor<ChunkedArray<BooleanType>> for BooleanChunked
impl BitXor<ChunkedArray<BooleanType>> for BooleanChunked
§type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
The resulting type after applying the
^
operator.source§impl ChunkAgg<u32> for BooleanChunked
impl ChunkAgg<u32> for BooleanChunked
Booleans are casted to 1 or 0.
source§fn sum(&self) -> Option<IdxSize>
fn sum(&self) -> Option<IdxSize>
Returns None
if the array is empty or only contains null values.
fn min(&self) -> Option<IdxSize>
source§impl ChunkAggSeries for BooleanChunked
impl ChunkAggSeries for BooleanChunked
source§fn sum_as_series(&self) -> Series
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
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
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
fn prod_as_series(&self) -> Series
Get the product of the ChunkedArray as a new Series of length 1.
source§impl ChunkAnyValue for BooleanChunked
impl ChunkAnyValue for BooleanChunked
source§unsafe fn get_any_value_unchecked(&self, index: usize) -> AnyValue<'_>
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<'_>>
fn get_any_value(&self, index: usize) -> PolarsResult<AnyValue<'_>>
Get a single value. Beware this is slow.
source§impl<'a> ChunkApply<'a, bool, bool> for BooleanChunked
impl<'a> ChunkApply<'a, bool, bool> for BooleanChunked
source§fn apply_cast_numeric<F, S>(&self, f: F) -> ChunkedArray<S>where
F: Fn(bool) -> S::Native + Copy,
S: PolarsNumericType,
fn apply_cast_numeric<F, S>(&self, f: F) -> ChunkedArray<S>where
F: Fn(bool) -> S::Native + Copy,
S: PolarsNumericType,
Apply a closure elementwise and cast to a Numeric ChunkedArray. This is fastest when the null check branching is more expensive
than the closure application. Read more
source§fn branch_apply_cast_numeric_no_null<F, S>(&self, f: F) -> ChunkedArray<S>where
F: Fn(Option<bool>) -> S::Native + Copy,
S: PolarsNumericType,
fn branch_apply_cast_numeric_no_null<F, S>(&self, f: F) -> ChunkedArray<S>where
F: Fn(Option<bool>) -> S::Native + Copy,
S: PolarsNumericType,
Apply a closure on optional values and cast to Numeric ChunkedArray without null values.
source§fn apply<F>(&self, f: F) -> Selfwhere
F: Fn(bool) -> bool + Copy,
fn apply<F>(&self, f: F) -> Selfwhere
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
fn try_apply<F>(&self, f: F) -> PolarsResult<Self>where
F: Fn(bool) -> PolarsResult<bool> + Copy,
source§fn apply_on_opt<F>(&'a self, f: F) -> Selfwhere
F: Fn(Option<bool>) -> Option<bool> + Copy,
fn apply_on_opt<F>(&'a self, f: F) -> Selfwhere
F: Fn(Option<bool>) -> Option<bool> + Copy,
Apply a closure elementwise including null values.
source§fn apply_with_idx<F>(&'a self, f: F) -> Selfwhere
F: Fn((usize, bool)) -> bool + Copy,
fn apply_with_idx<F>(&'a self, f: F) -> Selfwhere
F: Fn((usize, bool)) -> bool + Copy,
Apply a closure elementwise. The closure gets the index of the element as first argument.
source§impl ChunkApplyKernel<BooleanArray> for BooleanChunked
impl ChunkApplyKernel<BooleanArray> for BooleanChunked
source§fn apply_kernel(&self, f: &dyn Fn(&BooleanArray) -> ArrayRef) -> Self
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,
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
impl ChunkCast for BooleanChunked
source§fn cast(&self, data_type: &DataType) -> PolarsResult<Series>
fn cast(&self, data_type: &DataType) -> PolarsResult<Series>
Cast a
[ChunkedArray]
to [DataType]
source§fn cast_unchecked(&self, data_type: &DataType) -> PolarsResult<Series>
fn cast_unchecked(&self, data_type: &DataType) -> PolarsResult<Series>
Does not check if the cast is a valid one and may over/underflow
source§impl ChunkCompare<&ChunkedArray<BooleanType>> for BooleanChunked
impl ChunkCompare<&ChunkedArray<BooleanType>> for BooleanChunked
type Item = ChunkedArray<BooleanType>
source§fn equal(&self, rhs: &BooleanChunked) -> BooleanChunked
fn equal(&self, rhs: &BooleanChunked) -> BooleanChunked
Check for equality.
source§fn not_equal(&self, rhs: &BooleanChunked) -> BooleanChunked
fn not_equal(&self, rhs: &BooleanChunked) -> BooleanChunked
Check for inequality.
source§fn gt(&self, rhs: &BooleanChunked) -> BooleanChunked
fn gt(&self, rhs: &BooleanChunked) -> BooleanChunked
Greater than comparison.
source§fn gt_eq(&self, rhs: &BooleanChunked) -> BooleanChunked
fn gt_eq(&self, rhs: &BooleanChunked) -> BooleanChunked
Greater than or equal comparison.
source§fn lt(&self, rhs: &BooleanChunked) -> BooleanChunked
fn lt(&self, rhs: &BooleanChunked) -> BooleanChunked
Less than comparison.
source§fn lt_eq(&self, rhs: &BooleanChunked) -> BooleanChunked
fn lt_eq(&self, rhs: &BooleanChunked) -> BooleanChunked
Less than or equal comparison
source§impl ChunkExpandAtIndex<BooleanType> for BooleanChunked
impl ChunkExpandAtIndex<BooleanType> for BooleanChunked
source§fn new_from_index(&self, index: usize, length: usize) -> BooleanChunked
fn new_from_index(&self, index: usize, length: usize) -> BooleanChunked
Create a new ChunkedArray filled with values at that index.
source§impl ChunkFillNull for BooleanChunked
impl ChunkFillNull for BooleanChunked
source§fn fill_null(&self, strategy: FillNullStrategy) -> PolarsResult<Self>
fn fill_null(&self, strategy: FillNullStrategy) -> PolarsResult<Self>
Replace None values with one of the following strategies: Read more
source§impl ChunkFillNullValue<bool> for BooleanChunked
impl ChunkFillNullValue<bool> for BooleanChunked
source§fn fill_null_with_values(&self, value: bool) -> PolarsResult<Self>
fn fill_null_with_values(&self, value: bool) -> PolarsResult<Self>
Replace None values with a give value
T
.source§impl ChunkFilter<BooleanType> for BooleanChunked
impl ChunkFilter<BooleanType> for BooleanChunked
source§fn filter(
&self,
filter: &BooleanChunked
) -> PolarsResult<ChunkedArray<BooleanType>>
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
impl ChunkFull<bool> for BooleanChunked
source§impl ChunkFullNull for BooleanChunked
impl ChunkFullNull for BooleanChunked
source§impl ChunkQuantile<bool> for BooleanChunked
impl ChunkQuantile<bool> for BooleanChunked
source§fn median(&self) -> Option<T>
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>>
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<BooleanType> for BooleanChunked
impl ChunkReverse<BooleanType> for BooleanChunked
source§impl<'a> ChunkSet<'a, bool, bool> for BooleanChunked
impl<'a> ChunkSet<'a, bool, bool> for BooleanChunked
source§fn set_at_idx<I: IntoIterator<Item = IdxSize>>(
&'a self,
idx: I,
value: Option<bool>
) -> PolarsResult<Self>
fn set_at_idx<I: IntoIterator<Item = IdxSize>>(
&'a self,
idx: I,
value: Option<bool>
) -> PolarsResult<Self>
source§fn set_at_idx_with<I: IntoIterator<Item = IdxSize>, F>(
&'a self,
idx: I,
f: F
) -> PolarsResult<Self>where
F: Fn(Option<bool>) -> Option<bool>,
fn set_at_idx_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 moresource§fn set(&'a self, mask: &BooleanChunked, value: Option<bool>) -> PolarsResult<Self>
fn set(&'a self, mask: &BooleanChunked, value: Option<bool>) -> PolarsResult<Self>
source§impl ChunkShift<BooleanType> for BooleanChunked
impl ChunkShift<BooleanType> for BooleanChunked
source§impl ChunkShiftFill<BooleanType, Option<bool>> for BooleanChunked
impl ChunkShiftFill<BooleanType, Option<bool>> for BooleanChunked
source§fn shift_and_fill(&self, periods: i64, fill_value: Option<bool>) -> BooleanChunked
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
impl ChunkSort<BooleanType> for BooleanChunked
fn sort_with(&self, options: SortOptions) -> ChunkedArray<BooleanType>
source§fn sort(&self, reverse: bool) -> BooleanChunked
fn sort(&self, reverse: bool) -> BooleanChunked
Returned a sorted
ChunkedArray
.source§fn argsort(&self, options: SortOptions) -> IdxCa
fn argsort(&self, options: SortOptions) -> IdxCa
Retrieve the indexes needed to sort this array.
source§fn argsort_multiple(
&self,
_other: &[Series],
_reverse: &[bool]
) -> PolarsResult<IdxCa>
fn argsort_multiple(
&self,
_other: &[Series],
_reverse: &[bool]
) -> PolarsResult<IdxCa>
Retrieve the indexes need to sort this and the other arrays.
source§impl ChunkTake for BooleanChunked
impl ChunkTake for BooleanChunked
source§unsafe fn take_unchecked<I, INulls>(
&self,
indices: TakeIdx<'_, I, INulls>
) -> Selfwhere
Self: Sized,
I: TakeIterator,
INulls: TakeIteratorNulls,
unsafe fn take_unchecked<I, INulls>(
&self,
indices: TakeIdx<'_, I, INulls>
) -> Selfwhere
Self: Sized,
I: TakeIterator,
INulls: TakeIteratorNulls,
Take values from ChunkedArray by index. Read more
source§fn take<I, INulls>(&self, indices: TakeIdx<'_, I, INulls>) -> PolarsResult<Self>where
Self: Sized,
I: TakeIterator,
INulls: TakeIteratorNulls,
fn take<I, INulls>(&self, indices: TakeIdx<'_, I, INulls>) -> PolarsResult<Self>where
Self: Sized,
I: TakeIterator,
INulls: TakeIteratorNulls,
Take values from ChunkedArray by index.
Note that the iterator will be cloned, so prefer an iterator that takes the owned memory
by reference.
source§impl ChunkTakeEvery<BooleanType> for BooleanChunked
impl ChunkTakeEvery<BooleanType> for BooleanChunked
source§fn take_every(&self, n: usize) -> BooleanChunked
fn take_every(&self, n: usize) -> BooleanChunked
Traverse and collect every nth element in a new array.
source§impl ChunkUnique<BooleanType> for BooleanChunked
impl ChunkUnique<BooleanType> for BooleanChunked
source§fn unique(&self) -> PolarsResult<Self>
fn unique(&self) -> PolarsResult<Self>
Get unique values of a ChunkedArray
source§fn arg_unique(&self) -> PolarsResult<IdxCa>
fn arg_unique(&self) -> PolarsResult<IdxCa>
Get first index of the unique values in a
ChunkedArray
.
This Vec is sorted.source§fn is_unique(&self) -> PolarsResult<BooleanChunked>
fn is_unique(&self) -> PolarsResult<BooleanChunked>
Get a mask of all the unique values.
source§fn is_duplicated(&self) -> PolarsResult<BooleanChunked>
fn is_duplicated(&self) -> PolarsResult<BooleanChunked>
Get a mask of all the duplicated values.
source§fn n_unique(&self) -> PolarsResult<usize>
fn n_unique(&self) -> PolarsResult<usize>
Number of unique values in the
ChunkedArray
source§fn mode(&self) -> PolarsResult<ChunkedArray<T>>
fn mode(&self) -> PolarsResult<ChunkedArray<T>>
Available on crate feature
mode
only.The most occurring value(s). Can return multiple Values
source§impl ChunkVar<bool> for BooleanChunked
impl ChunkVar<bool> for BooleanChunked
source§impl ChunkZip<BooleanType> for BooleanChunked
Available on crate feature zip_with
only.
impl ChunkZip<BooleanType> for BooleanChunked
Available on crate feature
zip_with
only.source§fn zip_with(
&self,
mask: &BooleanChunked,
other: &BooleanChunked
) -> PolarsResult<BooleanChunked>
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 From<(&str, BooleanArray)> for BooleanChunked
impl From<(&str, BooleanArray)> for BooleanChunked
source§fn from(tpl: (&str, BooleanArray)) -> Self
fn from(tpl: (&str, BooleanArray)) -> Self
Converts to this type from the input type.
source§impl From<BooleanArray> for BooleanChunked
impl From<BooleanArray> for BooleanChunked
source§fn from(arr: BooleanArray) -> Self
fn from(arr: BooleanArray) -> Self
Converts to this type from the input type.
source§impl FromIterator<bool> for BooleanChunked
impl FromIterator<bool> for BooleanChunked
source§impl FromIteratorReversed<Option<bool>> for BooleanChunked
impl FromIteratorReversed<Option<bool>> for BooleanChunked
fn from_trusted_len_iter_rev<I: TrustedLen<Item = Option<bool>>>(
iter: I
) -> Self
source§impl FromParallelIterator<Option<bool>> for BooleanChunked
impl FromParallelIterator<Option<bool>> for BooleanChunked
source§fn from_par_iter<I: IntoParallelIterator<Item = Option<bool>>>(iter: I) -> Self
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 moresource§impl FromParallelIterator<bool> for BooleanChunked
impl FromParallelIterator<bool> for BooleanChunked
source§fn from_par_iter<I: IntoParallelIterator<Item = bool>>(iter: I) -> Self
fn from_par_iter<I: IntoParallelIterator<Item = bool>>(iter: I) -> Self
Creates an instance of the collection from the parallel iterator
par_iter
. Read moresource§impl FromTrustedLenIterator<bool> for BooleanChunked
impl FromTrustedLenIterator<bool> for BooleanChunked
fn from_iter_trusted_length<I: IntoIterator<Item = bool>>(iter: I) -> Selfwhere
I::IntoIter: TrustedLen,
source§impl IntoGroupsProxy for BooleanChunked
impl IntoGroupsProxy for BooleanChunked
source§fn group_tuples(
&self,
multithreaded: bool,
sorted: bool
) -> PolarsResult<GroupsProxy>
fn group_tuples(
&self,
multithreaded: bool,
sorted: bool
) -> PolarsResult<GroupsProxy>
Create the tuples need for a groupby 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
impl<'a> IntoIterator for &'a BooleanChunked
§type IntoIter = Box<dyn PolarsIterator<Item = <&'a ChunkedArray<BooleanType> as IntoIterator>::Item> + 'a, Global>
type IntoIter = Box<dyn PolarsIterator<Item = <&'a ChunkedArray<BooleanType> as IntoIterator>::Item> + 'a, Global>
Which kind of iterator are we turning this into?
source§impl<'a> IntoTakeRandom<'a> for &'a BooleanChunked
impl<'a> IntoTakeRandom<'a> for &'a BooleanChunked
type Item = bool
type TakeRandom = TakeRandBranch2<BoolTakeRandomSingleChunk<'a>, BoolTakeRandom<'a>>
source§fn take_rand(&self) -> Self::TakeRandom
fn take_rand(&self) -> Self::TakeRandom
Create a type that implements
TakeRandom
.source§impl IsIn for BooleanChunked
Available on crate feature is_in
only.
impl IsIn for BooleanChunked
Available on crate feature
is_in
only.source§fn is_in(&self, other: &Series) -> PolarsResult<BooleanChunked>
fn is_in(&self, other: &Series) -> PolarsResult<BooleanChunked>
Check if elements of this array are in the right Series, or List values of the right Series.
source§impl NewChunkedArray<BooleanType, bool> for BooleanChunked
impl NewChunkedArray<BooleanType, bool> for BooleanChunked
source§fn from_iter_values(
name: &str,
it: impl Iterator<Item = bool>
) -> ChunkedArray<BooleanType>
fn from_iter_values(
name: &str,
it: impl Iterator<Item = bool>
) -> ChunkedArray<BooleanType>
Create a new ChunkedArray from an iterator.
fn from_slice(name: &str, v: &[bool]) -> Self
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>
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
impl Not for &BooleanChunked
§type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
The resulting type after applying the
!
operator.source§impl Not for BooleanChunked
impl Not for BooleanChunked
§type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
The resulting type after applying the
!
operator.source§impl RepeatBy for BooleanChunked
Available on crate feature repeat_by
only.
impl RepeatBy for BooleanChunked
Available on crate feature
repeat_by
only.source§fn repeat_by(&self, by: &IdxCa) -> ListChunked
fn repeat_by(&self, by: &IdxCa) -> ListChunked
Repeat the values
n
times, where n
is determined by the values in by
.source§impl TakeRandom for BooleanChunked
impl TakeRandom for BooleanChunked
source§impl VecHash for BooleanChunked
impl VecHash for BooleanChunked
source§fn vec_hash(&self, random_state: RandomState, buf: &mut Vec<u64>)
fn vec_hash(&self, random_state: RandomState, buf: &mut Vec<u64>)
Compute the hash for all values in the array. Read more