pub type BooleanChunked = ChunkedArray<BooleanType>;Aliased Type§
pub struct BooleanChunked { /* private fields */ }Implementations§
Source§impl BooleanChunked
Booleans are cast to 1 or 0.
impl BooleanChunked
Booleans are cast to 1 or 0.
Source§impl BooleanChunked
impl BooleanChunked
pub fn num_trues(&self) -> usize
pub fn num_falses(&self) -> usize
pub fn first_true_idx(&self) -> Option<usize>
pub fn first_false_idx(&self) -> Option<usize>
Source§impl BooleanChunked
impl BooleanChunked
Sourcepub fn any(&self) -> bool
pub fn any(&self) -> bool
Returns whether any of the values in the column are true.
Null values are ignored.
Sourcepub fn all(&self) -> bool
pub fn all(&self) -> bool
Returns whether all values in the array are true.
Null values are ignored.
Sourcepub fn any_kleene(&self) -> Option<bool>
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.
Sourcepub fn all_kleene(&self) -> Option<bool>
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
impl BooleanChunked
Sourcepub unsafe fn mmap_slice(
name: PlSmallStr,
values: &[u8],
offset: usize,
len: usize,
) -> Self
pub unsafe fn mmap_slice( name: PlSmallStr, 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.
pub fn from_bitmap(name: PlSmallStr, bitmap: Bitmap) -> Self
Source§impl BooleanChunked
impl BooleanChunked
Sourcepub fn rand_bernoulli(
name: PlSmallStr,
length: usize,
p: f64,
) -> PolarsResult<Self>
Available on crate feature random only.
pub fn rand_bernoulli( name: PlSmallStr, length: usize, p: f64, ) -> PolarsResult<Self>
random only.Create ChunkedArray with samples from a Bernoulli distribution.
Source§impl BooleanChunked
impl BooleanChunked
Sourcepub unsafe fn agg_any(
&self,
groups: &GroupsType,
ignore_nulls: bool,
) -> BooleanChunked
Available on crate feature algorithm_group_by only.
pub unsafe fn agg_any( &self, groups: &GroupsType, ignore_nulls: bool, ) -> BooleanChunked
algorithm_group_by only.§Safety
Groups should be in correct.
Sourcepub unsafe fn agg_all(
&self,
groups: &GroupsType,
ignore_nulls: bool,
) -> BooleanChunked
Available on crate feature algorithm_group_by only.
pub unsafe fn agg_all( &self, groups: &GroupsType, ignore_nulls: bool, ) -> BooleanChunked
algorithm_group_by only.§Safety
Groups should be in correct.
Trait Implementations§
Source§impl Add for &BooleanChunked
impl Add for &BooleanChunked
Source§type Output = ChunkedArray<UInt32Type>
type Output = ChunkedArray<UInt32Type>
+ operator.Source§impl Add for BooleanChunked
impl Add for BooleanChunked
Source§type Output = ChunkedArray<UInt32Type>
type Output = ChunkedArray<UInt32Type>
+ operator.Source§impl AggList for BooleanChunked
Available on crate feature algorithm_group_by only.
impl AggList for BooleanChunked
algorithm_group_by only.Source§impl BitAnd for &BooleanChunked
impl BitAnd for &BooleanChunked
Source§type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
& operator.Source§impl BitAnd for BooleanChunked
impl BitAnd for BooleanChunked
Source§type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
& operator.Source§impl BitOr for &BooleanChunked
impl BitOr for &BooleanChunked
Source§type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
| operator.Source§impl BitOr for BooleanChunked
impl BitOr for BooleanChunked
Source§type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
| operator.Source§impl BitXor for &BooleanChunked
impl BitXor for &BooleanChunked
Source§type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
^ operator.Source§impl BitXor for BooleanChunked
impl BitXor for BooleanChunked
Source§type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
^ operator.Source§impl ChunkAggSeries for BooleanChunked
impl ChunkAggSeries for BooleanChunked
Source§fn sum_reduce(&self) -> Scalar
fn sum_reduce(&self) -> Scalar
ChunkedArray as a new Series of length 1.Source§fn max_reduce(&self) -> Scalar
fn max_reduce(&self) -> Scalar
ChunkedArray as a new Series of length 1.Source§fn min_reduce(&self) -> Scalar
fn min_reduce(&self) -> Scalar
ChunkedArray as a new Series of length 1.Source§fn prod_reduce(&self) -> Scalar
fn prod_reduce(&self) -> Scalar
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<'_>
Source§fn get_any_value(&self, index: usize) -> PolarsResult<AnyValue<'_>>
fn get_any_value(&self, index: usize) -> PolarsResult<AnyValue<'_>>
Source§impl<'a> ChunkApply<'a, bool> for BooleanChunked
impl<'a> ChunkApply<'a, bool> for BooleanChunked
type FuncRet = bool
Source§fn apply_values<F>(&self, f: F) -> Self
fn apply_values<F>(&self, f: F) -> Self
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
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,
Source§impl ChunkCast for BooleanChunked
impl ChunkCast for BooleanChunked
Source§fn cast_with_options(
&self,
dtype: &DataType,
options: CastOptions,
) -> PolarsResult<Series>
fn cast_with_options( &self, dtype: &DataType, options: CastOptions, ) -> PolarsResult<Series>
ChunkedArray to DataTypeSource§unsafe fn cast_unchecked(&self, dtype: &DataType) -> PolarsResult<Series>
unsafe fn cast_unchecked(&self, dtype: &DataType) -> PolarsResult<Series>
Source§fn cast(&self, dtype: &DataType) -> PolarsResult<Series>
fn cast(&self, dtype: &DataType) -> PolarsResult<Series>
ChunkedArray to DataTypeSource§impl ChunkCompareEq<&ChunkedArray<BooleanType>> for BooleanChunked
impl ChunkCompareEq<&ChunkedArray<BooleanType>> for BooleanChunked
type Item = ChunkedArray<BooleanType>
Source§fn equal(&self, rhs: &BooleanChunked) -> BooleanChunked
fn equal(&self, rhs: &BooleanChunked) -> BooleanChunked
Source§fn equal_missing(&self, rhs: &BooleanChunked) -> BooleanChunked
fn equal_missing(&self, rhs: &BooleanChunked) -> BooleanChunked
None == None.Source§fn not_equal(&self, rhs: &BooleanChunked) -> BooleanChunked
fn not_equal(&self, rhs: &BooleanChunked) -> BooleanChunked
Source§fn not_equal_missing(&self, rhs: &BooleanChunked) -> BooleanChunked
fn not_equal_missing(&self, rhs: &BooleanChunked) -> BooleanChunked
None == None.Source§impl ChunkCompareIneq<&ChunkedArray<BooleanType>> for BooleanChunked
impl ChunkCompareIneq<&ChunkedArray<BooleanType>> for BooleanChunked
type Item = ChunkedArray<BooleanType>
Source§fn lt(&self, rhs: &BooleanChunked) -> BooleanChunked
fn lt(&self, rhs: &BooleanChunked) -> BooleanChunked
Source§fn lt_eq(&self, rhs: &BooleanChunked) -> BooleanChunked
fn lt_eq(&self, rhs: &BooleanChunked) -> BooleanChunked
Source§fn gt(&self, rhs: &Self) -> BooleanChunked
fn gt(&self, rhs: &Self) -> BooleanChunked
Source§fn gt_eq(&self, rhs: &Self) -> BooleanChunked
fn gt_eq(&self, rhs: &Self) -> BooleanChunked
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
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>
T.Source§impl ChunkFull<bool> for BooleanChunked
impl ChunkFull<bool> for BooleanChunked
Source§impl ChunkFullNull for BooleanChunked
impl ChunkFullNull for BooleanChunked
fn full_null(name: PlSmallStr, length: usize) -> Self
Source§impl ChunkQuantile<bool> for BooleanChunked
impl ChunkQuantile<bool> for BooleanChunked
Source§fn median(&self) -> Option<T>
fn median(&self) -> Option<T>
None if the array is empty or only contains null values.Source§fn quantile(
&self,
_quantile: f64,
_method: QuantileMethod,
) -> PolarsResult<Option<T>>
fn quantile( &self, _quantile: f64, _method: QuantileMethod, ) -> PolarsResult<Option<T>>
None if the array is empty or only contains null values.Source§fn quantiles(
&self,
quantiles: &[f64],
_method: QuantileMethod,
) -> PolarsResult<Vec<Option<T>>>where
T: Clone,
fn quantiles(
&self,
quantiles: &[f64],
_method: QuantileMethod,
) -> PolarsResult<Vec<Option<T>>>where
T: Clone,
None if the array is empty or only contains null values.Source§impl ChunkReverse for BooleanChunked
impl ChunkReverse for BooleanChunked
Source§impl<'a> ChunkSet<'a, bool, bool> for BooleanChunked
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>
fn scatter_single<I: IntoIterator<Item = IdxSize>>( &'a self, idx: I, value: Option<bool>, ) -> PolarsResult<Self>
Source§fn scatter_with<I: IntoIterator<Item = IdxSize>, F>(
&'a self,
idx: I,
f: F,
) -> PolarsResult<Self>
fn scatter_with<I: IntoIterator<Item = IdxSize>, F>( &'a self, idx: I, f: F, ) -> PolarsResult<Self>
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 ChunkSort<BooleanType> for BooleanChunked
impl ChunkSort<BooleanType> for BooleanChunked
fn sort_with(&self, options: SortOptions) -> ChunkedArray<BooleanType>
Source§fn sort(&self, descending: bool) -> BooleanChunked
fn sort(&self, descending: bool) -> BooleanChunked
ChunkedArray.Source§fn arg_sort(&self, options: SortOptions) -> IdxCa
fn arg_sort(&self, options: SortOptions) -> IdxCa
Source§fn arg_sort_multiple(
&self,
by: &[Column],
options: &SortMultipleOptions,
) -> PolarsResult<IdxCa>
fn arg_sort_multiple( &self, by: &[Column], options: &SortMultipleOptions, ) -> PolarsResult<IdxCa>
Source§impl ChunkUnique for BooleanChunked
Available on crate feature algorithm_group_by only.
impl ChunkUnique for BooleanChunked
algorithm_group_by only.Source§fn unique(&self) -> PolarsResult<Self>
fn unique(&self) -> PolarsResult<Self>
Source§fn arg_unique(&self) -> PolarsResult<IdxCa>
fn arg_unique(&self) -> PolarsResult<IdxCa>
ChunkedArray.
This Vec is sorted.Source§fn unique_id(&self) -> PolarsResult<(IdxSize, Vec<IdxSize>)>
fn unique_id(&self) -> PolarsResult<(IdxSize, Vec<IdxSize>)>
Source§fn n_unique(&self) -> PolarsResult<usize>
fn n_unique(&self) -> PolarsResult<usize>
ChunkedArraySource§impl ChunkVar for BooleanChunked
impl ChunkVar for BooleanChunked
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§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
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 IntoGroupsType for BooleanChunked
Available on crate feature algorithm_group_by only.
impl IntoGroupsType for BooleanChunked
algorithm_group_by only.Source§fn group_tuples(
&self,
multithreaded: bool,
sorted: bool,
) -> PolarsResult<GroupsType>
fn group_tuples( &self, multithreaded: bool, sorted: bool, ) -> PolarsResult<GroupsType>
Source§impl<'a> IntoIterator for &'a BooleanChunked
impl<'a> IntoIterator for &'a BooleanChunked
Source§type IntoIter = Box<dyn PolarsIterator<Item = <&'a ChunkedArray<BooleanType> as IntoIterator>::Item> + 'a>
type IntoIter = Box<dyn PolarsIterator<Item = <&'a ChunkedArray<BooleanType> as IntoIterator>::Item> + 'a>
Source§impl NewChunkedArray<BooleanType, bool> for BooleanChunked
impl NewChunkedArray<BooleanType, bool> for BooleanChunked
Source§fn from_iter_values(
name: PlSmallStr,
it: impl Iterator<Item = bool>,
) -> ChunkedArray<BooleanType>
fn from_iter_values( name: PlSmallStr, it: impl Iterator<Item = bool>, ) -> ChunkedArray<BooleanType>
Create a new ChunkedArray from an iterator.
fn from_slice(name: PlSmallStr, v: &[bool]) -> Self
fn from_slice_options(name: PlSmallStr, opt_v: &[Option<bool>]) -> Self
Source§fn from_iter_options(
name: PlSmallStr,
it: impl Iterator<Item = Option<bool>>,
) -> ChunkedArray<BooleanType>
fn from_iter_options( name: PlSmallStr, it: impl Iterator<Item = Option<bool>>, ) -> ChunkedArray<BooleanType>
Source§impl Not for &BooleanChunked
impl Not for &BooleanChunked
Source§type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
! operator.Source§impl Not for BooleanChunked
impl Not for BooleanChunked
Source§type Output = ChunkedArray<BooleanType>
type Output = ChunkedArray<BooleanType>
! operator.