pub struct Logical<Logical, Physical>(pub ChunkedArray<Physical>, _, pub Option<DataType>)
where
Logical: PolarsDataType,
Physical: PolarsDataType;
Expand description
Maps a logical type to a chunked array implementation of the physical type. This saves a lot of compiler bloat and allows us to reuse functionality.
Tuple Fields§
§0: ChunkedArray<Physical>
§2: Option<DataType>
Implementations§
Source§impl Logical<DecimalType, Int128Type>
impl Logical<DecimalType, Int128Type>
Source§impl<K, T> Logical<K, T>where
K: PolarsDataType,
T: PolarsDataType,
impl<K, T> Logical<K, T>where
K: PolarsDataType,
T: PolarsDataType,
pub fn new_logical<J>(ca: ChunkedArray<T>) -> Logical<J, T>where
J: PolarsDataType,
Source§impl Logical<DateType, Int32Type>
impl Logical<DateType, Int32Type>
pub fn as_date_iter(&self) -> impl TrustedLen
Sourcepub fn from_naive_date<I>(
name: PlSmallStr,
v: I,
) -> Logical<DateType, Int32Type>where
I: IntoIterator<Item = NaiveDate>,
pub fn from_naive_date<I>(
name: PlSmallStr,
v: I,
) -> Logical<DateType, Int32Type>where
I: IntoIterator<Item = NaiveDate>,
Construct a new DateChunked
from an iterator over NaiveDate
.
Sourcepub fn to_string(
&self,
format: &str,
) -> Result<ChunkedArray<StringType>, PolarsError>
pub fn to_string( &self, format: &str, ) -> Result<ChunkedArray<StringType>, PolarsError>
Convert from Date into String with the given format. See chrono strftime/strptime.
Sourcepub fn strftime(
&self,
format: &str,
) -> Result<ChunkedArray<StringType>, PolarsError>
pub fn strftime( &self, format: &str, ) -> Result<ChunkedArray<StringType>, PolarsError>
Convert from Date into String with the given format. See chrono strftime/strptime.
Alias for to_string
.
Sourcepub fn from_naive_date_options<I>(
name: PlSmallStr,
v: I,
) -> Logical<DateType, Int32Type>
pub fn from_naive_date_options<I>( name: PlSmallStr, v: I, ) -> Logical<DateType, Int32Type>
Construct a new DateChunked
from an iterator over optional NaiveDate
.
Source§impl Logical<DatetimeType, Int64Type>
impl Logical<DatetimeType, Int64Type>
pub fn as_datetime_iter(&self) -> impl TrustedLen
pub fn time_unit(&self) -> TimeUnit
pub fn time_zone(&self) -> &Option<PlSmallStr>
Sourcepub fn to_string(
&self,
format: &str,
) -> Result<ChunkedArray<StringType>, PolarsError>
pub fn to_string( &self, format: &str, ) -> Result<ChunkedArray<StringType>, PolarsError>
Convert from Datetime into String with the given format. See chrono strftime/strptime.
Sourcepub fn strftime(
&self,
format: &str,
) -> Result<ChunkedArray<StringType>, PolarsError>
pub fn strftime( &self, format: &str, ) -> Result<ChunkedArray<StringType>, PolarsError>
Convert from Datetime into String with the given format. See chrono strftime/strptime.
Alias for to_string
.
Sourcepub fn from_naive_datetime<I>(
name: PlSmallStr,
v: I,
tu: TimeUnit,
) -> Logical<DatetimeType, Int64Type>where
I: IntoIterator<Item = NaiveDateTime>,
pub fn from_naive_datetime<I>(
name: PlSmallStr,
v: I,
tu: TimeUnit,
) -> Logical<DatetimeType, Int64Type>where
I: IntoIterator<Item = NaiveDateTime>,
Construct a new DatetimeChunked
from an iterator over NaiveDateTime
.
pub fn from_naive_datetime_options<I>( name: PlSmallStr, v: I, tu: TimeUnit, ) -> Logical<DatetimeType, Int64Type>
Sourcepub fn cast_time_unit(&self, tu: TimeUnit) -> Logical<DatetimeType, Int64Type>
pub fn cast_time_unit(&self, tu: TimeUnit) -> Logical<DatetimeType, Int64Type>
Change the underlying TimeUnit
. And update the data accordingly.
Sourcepub fn set_time_unit(&mut self, time_unit: TimeUnit)
pub fn set_time_unit(&mut self, time_unit: TimeUnit)
Change the underlying TimeUnit
. This does not modify the data.
Sourcepub fn set_time_zone(
&mut self,
time_zone: PlSmallStr,
) -> Result<(), PolarsError>
pub fn set_time_zone( &mut self, time_zone: PlSmallStr, ) -> Result<(), PolarsError>
Change the underlying TimeZone
. This does not modify the data.
This does not validate the time zone - it’s up to the caller to verify that it’s
already been validated.
Sourcepub fn set_time_unit_and_time_zone(
&mut self,
time_unit: TimeUnit,
time_zone: PlSmallStr,
) -> Result<(), PolarsError>
pub fn set_time_unit_and_time_zone( &mut self, time_unit: TimeUnit, time_zone: PlSmallStr, ) -> Result<(), PolarsError>
Source§impl Logical<DurationType, Int64Type>
impl Logical<DurationType, Int64Type>
pub fn time_unit(&self) -> TimeUnit
Sourcepub fn cast_time_unit(&self, tu: TimeUnit) -> Logical<DurationType, Int64Type>
pub fn cast_time_unit(&self, tu: TimeUnit) -> Logical<DurationType, Int64Type>
Change the underlying TimeUnit
. And update the data accordingly.
Sourcepub fn set_time_unit(&mut self, tu: TimeUnit)
pub fn set_time_unit(&mut self, tu: TimeUnit)
Change the underlying TimeUnit
. This does not modify the data.
Sourcepub fn to_string(
&self,
format: &str,
) -> Result<ChunkedArray<StringType>, PolarsError>
pub fn to_string( &self, format: &str, ) -> Result<ChunkedArray<StringType>, PolarsError>
Convert from Duration
to String; note that strftime
format
strings are not supported, only the specifiers ‘iso’ and ‘polars’.
Sourcepub fn from_duration<I>(
name: PlSmallStr,
v: I,
tu: TimeUnit,
) -> Logical<DurationType, Int64Type>where
I: IntoIterator<Item = TimeDelta>,
pub fn from_duration<I>(
name: PlSmallStr,
v: I,
tu: TimeUnit,
) -> Logical<DurationType, Int64Type>where
I: IntoIterator<Item = TimeDelta>,
Construct a new DurationChunked
from an iterator over ChronoDuration
.
Sourcepub fn from_duration_options<I>(
name: PlSmallStr,
v: I,
tu: TimeUnit,
) -> Logical<DurationType, Int64Type>
pub fn from_duration_options<I>( name: PlSmallStr, v: I, tu: TimeUnit, ) -> Logical<DurationType, Int64Type>
Construct a new DurationChunked
from an iterator over optional ChronoDuration
.
Source§impl Logical<TimeType, Int64Type>
impl Logical<TimeType, Int64Type>
Sourcepub fn to_string(&self, format: &str) -> ChunkedArray<StringType>
pub fn to_string(&self, format: &str) -> ChunkedArray<StringType>
Convert from Time into String with the given format. See chrono strftime/strptime.
Sourcepub fn strftime(&self, format: &str) -> ChunkedArray<StringType>
pub fn strftime(&self, format: &str) -> ChunkedArray<StringType>
Convert from Time into String with the given format. See chrono strftime/strptime.
Alias for to_string
.
pub fn as_time_iter(&self) -> impl TrustedLen
Sourcepub fn from_naive_time<I>(
name: PlSmallStr,
v: I,
) -> Logical<TimeType, Int64Type>where
I: IntoIterator<Item = NaiveTime>,
pub fn from_naive_time<I>(
name: PlSmallStr,
v: I,
) -> Logical<TimeType, Int64Type>where
I: IntoIterator<Item = NaiveTime>,
Construct a new TimeChunked
from an iterator over NaiveTime
.
Sourcepub fn from_naive_time_options<I>(
name: PlSmallStr,
v: I,
) -> Logical<TimeType, Int64Type>
pub fn from_naive_time_options<I>( name: PlSmallStr, v: I, ) -> Logical<TimeType, Int64Type>
Construct a new TimeChunked
from an iterator over optional NaiveTime
.
Methods from Deref<Target = ChunkedArray<T>>§
Sourcepub fn append(&mut self, other: &ChunkedArray<T>) -> Result<(), PolarsError>
pub fn append(&mut self, other: &ChunkedArray<T>) -> Result<(), PolarsError>
Append in place. This is done by adding the chunks of other
to this ChunkedArray
.
See also extend
for appends to the underlying memory
Sourcepub fn append_owned(
&mut self,
other: ChunkedArray<T>,
) -> Result<(), PolarsError>
pub fn append_owned( &mut self, other: ChunkedArray<T>, ) -> Result<(), PolarsError>
Append in place. This is done by adding the chunks of other
to this ChunkedArray
.
See also extend
for appends to the underlying memory
Sourcepub fn apply_nonnull_values_generic<'a, U, K, F>(
&'a self,
dtype: DataType,
op: F,
) -> ChunkedArray<U>where
U: PolarsDataType,
F: FnMut(<T as PolarsDataType>::Physical<'a>) -> K,
<U as PolarsDataType>::Array: ArrayFromIterDtype<K> + ArrayFromIterDtype<Option<K>>,
pub fn apply_nonnull_values_generic<'a, U, K, F>(
&'a self,
dtype: DataType,
op: F,
) -> ChunkedArray<U>where
U: PolarsDataType,
F: FnMut(<T as PolarsDataType>::Physical<'a>) -> K,
<U as PolarsDataType>::Array: ArrayFromIterDtype<K> + ArrayFromIterDtype<Option<K>>,
Applies a function only to the non-null elements, propagating nulls.
Sourcepub fn try_apply_nonnull_values_generic<'a, U, K, F, E>(
&'a self,
op: F,
) -> Result<ChunkedArray<U>, E>where
U: PolarsDataType,
F: FnMut(<T as PolarsDataType>::Physical<'a>) -> Result<K, E>,
<U as PolarsDataType>::Array: ArrayFromIter<K> + ArrayFromIter<Option<K>>,
pub fn try_apply_nonnull_values_generic<'a, U, K, F, E>(
&'a self,
op: F,
) -> Result<ChunkedArray<U>, E>where
U: PolarsDataType,
F: FnMut(<T as PolarsDataType>::Physical<'a>) -> Result<K, E>,
<U as PolarsDataType>::Array: ArrayFromIter<K> + ArrayFromIter<Option<K>>,
Applies a function only to the non-null elements, propagating nulls.
pub fn apply_into_string_amortized<'a, F>( &'a self, f: F, ) -> ChunkedArray<StringType>
pub fn try_apply_into_string_amortized<'a, F, E>( &'a self, f: F, ) -> Result<ChunkedArray<StringType>, E>
Sourcepub fn cast_and_apply_in_place<F, S>(&self, f: F) -> ChunkedArray<S>where
F: Fn(<S as PolarsNumericType>::Native) -> <S as PolarsNumericType>::Native + Copy,
S: PolarsNumericType,
pub fn cast_and_apply_in_place<F, S>(&self, f: F) -> ChunkedArray<S>where
F: Fn(<S as PolarsNumericType>::Native) -> <S as PolarsNumericType>::Native + Copy,
S: PolarsNumericType,
Cast a numeric array to another numeric data type and apply a function in place. This saves an allocation.
pub fn apply_mut<F>(&mut self, f: F)
Sourcepub fn null_count(&self) -> usize
pub fn null_count(&self) -> usize
Return the number of null values in the ChunkedArray.
Sourcepub unsafe fn set_null_count(&mut self, null_count: usize)
pub unsafe fn set_null_count(&mut self, null_count: usize)
Set the null count directly.
This can be useful after mutably adjusting the validity of the underlying arrays.
§Safety
The new null count must match the total null count of the underlying arrays.
Sourcepub fn rechunk(&self) -> Cow<'_, ChunkedArray<T>>
pub fn rechunk(&self) -> Cow<'_, ChunkedArray<T>>
Rechunks this ChunkedArray, returning a new Cow::Owned ChunkedArray if it was rechunked or simply a Cow::Borrowed of itself if it was already a single chunk.
Sourcepub fn rechunk_mut(&mut self)
pub fn rechunk_mut(&mut self)
Rechunks this ChunkedArray in-place.
pub fn rechunk_validity(&self) -> Option<Bitmap>
pub fn with_validities(&mut self, validities: &[Option<Bitmap>])
Sourcepub fn split_at(&self, offset: i64) -> (ChunkedArray<T>, ChunkedArray<T>)
pub fn split_at(&self, offset: i64) -> (ChunkedArray<T>, ChunkedArray<T>)
Split the array. The chunks are reallocated the underlying data slices are zero copy.
When offset is negative it will be counted from the end of the array. This method will never error, and will slice the best match when offset, or length is out of bounds
Sourcepub fn slice(&self, offset: i64, length: usize) -> ChunkedArray<T>
pub fn slice(&self, offset: i64, length: usize) -> ChunkedArray<T>
Slice the array. The chunks are reallocated the underlying data slices are zero copy.
When offset is negative it will be counted from the end of the array. This method will never error, and will slice the best match when offset, or length is out of bounds
Sourcepub fn limit(&self, num_elements: usize) -> ChunkedArray<T>where
ChunkedArray<T>: Sized,
pub fn limit(&self, num_elements: usize) -> ChunkedArray<T>where
ChunkedArray<T>: Sized,
Take a view of top n elements
Sourcepub fn head(&self, length: Option<usize>) -> ChunkedArray<T>where
ChunkedArray<T>: Sized,
pub fn head(&self, length: Option<usize>) -> ChunkedArray<T>where
ChunkedArray<T>: Sized,
Get the head of the ChunkedArray
Sourcepub fn tail(&self, length: Option<usize>) -> ChunkedArray<T>where
ChunkedArray<T>: Sized,
pub fn tail(&self, length: Option<usize>) -> ChunkedArray<T>where
ChunkedArray<T>: Sized,
Get the tail of the ChunkedArray
Sourcepub fn prune_empty_chunks(&mut self)
pub fn prune_empty_chunks(&mut self)
Remove empty chunks.
Sourcepub fn extend(&mut self, other: &ChunkedArray<T>) -> Result<(), PolarsError>
pub fn extend(&mut self, other: &ChunkedArray<T>) -> Result<(), PolarsError>
Extend the memory backed by this array with the values from other
.
Different from ChunkedArray::append
which adds chunks to this ChunkedArray
extend
appends the data from other
to the underlying PrimitiveArray
and thus may cause a reallocation.
However if this does not cause a reallocation, the resulting data structure will not have any extra chunks and thus will yield faster queries.
Prefer extend
over append
when you want to do a query after a single append. For instance during
online operations where you add n
rows and rerun a query.
Prefer append
over extend
when you want to append many times before doing a query. For instance
when you read in multiple files and when to store them in a single DataFrame
.
In the latter case finish the sequence of append
operations with a rechunk
.
pub fn for_each<'a, F>(&'a self, op: F)
Sourcepub fn is_null(&self) -> ChunkedArray<BooleanType>
pub fn is_null(&self) -> ChunkedArray<BooleanType>
Get a mask of the null values.
Sourcepub fn is_not_null(&self) -> ChunkedArray<BooleanType>
pub fn is_not_null(&self) -> ChunkedArray<BooleanType>
Get a mask of the valid values.
Sourcepub fn rolling_map_float<F>(
&self,
window_size: usize,
f: F,
) -> Result<ChunkedArray<T>, PolarsError>
pub fn rolling_map_float<F>( &self, window_size: usize, f: F, ) -> Result<ChunkedArray<T>, PolarsError>
Apply a rolling custom function. This is pretty slow because of dynamic dispatch.
pub fn is_nan(&self) -> ChunkedArray<BooleanType>
pub fn is_not_nan(&self) -> ChunkedArray<BooleanType>
pub fn is_finite(&self) -> ChunkedArray<BooleanType>
pub fn is_infinite(&self) -> ChunkedArray<BooleanType>
Sourcepub fn none_to_nan(&self) -> ChunkedArray<T>
pub fn none_to_nan(&self) -> ChunkedArray<T>
Convert missing values to NaN
values.
pub fn to_canonical(&self) -> ChunkedArray<T>
pub fn iter(&self) -> impl PolarsIterator
Sourcepub fn to_ndarray(
&self,
) -> Result<ArrayBase<ViewRepr<&<T as PolarsNumericType>::Native>, Dim<[usize; 1]>>, PolarsError>
pub fn to_ndarray( &self, ) -> Result<ArrayBase<ViewRepr<&<T as PolarsNumericType>::Native>, Dim<[usize; 1]>>, PolarsError>
If data is aligned in a single chunk and has no Null values a zero copy view is returned as an ndarray
pub fn to_bytes_hashes<'a>( &'a self, multithreaded: bool, hb: RandomState, ) -> Vec<Vec<BytesHash<'a>>>
Sourcepub unsafe fn with_chunks(&self, chunks: Vec<Box<dyn Array>>) -> ChunkedArray<T>
pub unsafe fn with_chunks(&self, chunks: Vec<Box<dyn Array>>) -> ChunkedArray<T>
§Safety
The Arrow datatype of all chunks must match the PolarsDataType
T
.
Sourcepub fn sample_n(
&self,
n: usize,
with_replacement: bool,
shuffle: bool,
seed: Option<u64>,
) -> Result<ChunkedArray<T>, PolarsError>
pub fn sample_n( &self, n: usize, with_replacement: bool, shuffle: bool, seed: Option<u64>, ) -> Result<ChunkedArray<T>, PolarsError>
Sample n datapoints from this ChunkedArray
.
Sourcepub fn sample_frac(
&self,
frac: f64,
with_replacement: bool,
shuffle: bool,
seed: Option<u64>,
) -> Result<ChunkedArray<T>, PolarsError>
pub fn sample_frac( &self, frac: f64, with_replacement: bool, shuffle: bool, seed: Option<u64>, ) -> Result<ChunkedArray<T>, PolarsError>
Sample a fraction between 0.0-1.0 of this ChunkedArray
.
Sourcepub fn to_vec(&self) -> Vec<Option<<T as PolarsNumericType>::Native>>
pub fn to_vec(&self) -> Vec<Option<<T as PolarsNumericType>::Native>>
Convert to a Vec
of Option<T::Native>
.
Sourcepub fn to_vec_null_aware(
&self,
) -> Either<Vec<<T as PolarsNumericType>::Native>, Vec<Option<<T as PolarsNumericType>::Native>>> ⓘ
pub fn to_vec_null_aware( &self, ) -> Either<Vec<<T as PolarsNumericType>::Native>, Vec<Option<<T as PolarsNumericType>::Native>>> ⓘ
Convert to a Vec
but don’t return Option<T::Native>
if there are no null values
Sourcepub fn unpack_series_matching_type<'a>(
&self,
series: &'a Series,
) -> Result<&'a ChunkedArray<T>, PolarsError>
pub fn unpack_series_matching_type<'a>( &self, series: &'a Series, ) -> Result<&'a ChunkedArray<T>, PolarsError>
Series to ChunkedArray<T>
pub fn unset_fast_explode_list(&mut self)
pub fn set_fast_explode_list(&mut self, value: bool)
pub fn get_fast_explode_list(&self) -> bool
pub fn get_flags(&self) -> StatisticsFlags
pub fn is_sorted_flag(&self) -> IsSorted
pub fn retain_flags_from<U>(
&mut self,
from: &ChunkedArray<U>,
retain_flags: StatisticsFlags,
)where
U: PolarsDataType,
Sourcepub fn set_sorted_flag(&mut self, sorted: IsSorted)
pub fn set_sorted_flag(&mut self, sorted: IsSorted)
Set the ‘sorted’ bit meta info.
Sourcepub fn with_sorted_flag(&self, sorted: IsSorted) -> ChunkedArray<T>
pub fn with_sorted_flag(&self, sorted: IsSorted) -> ChunkedArray<T>
Set the ‘sorted’ bit meta info.
Sourcepub fn first_non_null(&self) -> Option<usize>
pub fn first_non_null(&self) -> Option<usize>
Get the index of the first non null value in this ChunkedArray
.
Sourcepub fn last_non_null(&self) -> Option<usize>
pub fn last_non_null(&self) -> Option<usize>
Get the index of the last non null value in this ChunkedArray
.
pub fn drop_nulls(&self) -> ChunkedArray<T>
Sourcepub fn iter_validities(
&self,
) -> Map<Iter<'_, Box<dyn Array>>, fn(&Box<dyn Array>) -> Option<&Bitmap>> ⓘ
pub fn iter_validities( &self, ) -> Map<Iter<'_, Box<dyn Array>>, fn(&Box<dyn Array>) -> Option<&Bitmap>> ⓘ
Get the buffer of bits representing null values
Sourcepub fn has_nulls(&self) -> bool
pub fn has_nulls(&self) -> bool
Return if any the chunks in this ChunkedArray
have nulls.
Sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrink the capacity of this array to fit its length.
pub fn clear(&self) -> ChunkedArray<T>
Sourcepub fn chunk_lengths(
&self,
) -> Map<Iter<'_, Box<dyn Array>>, fn(&Box<dyn Array>) -> usize> ⓘ
pub fn chunk_lengths( &self, ) -> Map<Iter<'_, Box<dyn Array>>, fn(&Box<dyn Array>) -> usize> ⓘ
Returns an iterator over the lengths of the chunks of the array.
Sourcepub unsafe fn chunks_mut(&mut self) -> &mut Vec<Box<dyn Array>>
pub unsafe fn chunks_mut(&mut self) -> &mut Vec<Box<dyn Array>>
Sourcepub fn is_optimal_aligned(&self) -> bool
pub fn is_optimal_aligned(&self) -> bool
Returns true if contains a single chunk and has no null values
Sourcepub fn dtype(&self) -> &DataType
pub fn dtype(&self) -> &DataType
Get data type of ChunkedArray
.
Sourcepub fn name(&self) -> &PlSmallStr
pub fn name(&self) -> &PlSmallStr
Name of the ChunkedArray
.
Sourcepub fn rename(&mut self, name: PlSmallStr)
pub fn rename(&mut self, name: PlSmallStr)
Rename this ChunkedArray
.
Sourcepub fn get(&self, idx: usize) -> Option<<T as PolarsDataType>::Physical<'_>>
pub fn get(&self, idx: usize) -> Option<<T as PolarsDataType>::Physical<'_>>
Get a single value from this ChunkedArray
. If the return values is None
this
indicates a NULL value.
§Panics
This function will panic if idx
is out of bounds.
Sourcepub unsafe fn get_unchecked(
&self,
idx: usize,
) -> Option<<T as PolarsDataType>::Physical<'_>>
pub unsafe fn get_unchecked( &self, idx: usize, ) -> Option<<T as PolarsDataType>::Physical<'_>>
Get a single value from this ChunkedArray
. If the return values is None
this
indicates a NULL value.
§Safety
It is the callers responsibility that the idx < self.len()
.
Sourcepub unsafe fn value_unchecked(
&self,
idx: usize,
) -> <T as PolarsDataType>::Physical<'_>
pub unsafe fn value_unchecked( &self, idx: usize, ) -> <T as PolarsDataType>::Physical<'_>
Get a single value from this ChunkedArray
. Null values are ignored and the returned
value could be garbage if it was masked out by NULL. Note that the value always is initialized.
§Safety
It is the callers responsibility that the idx < self.len()
.
pub fn first(&self) -> Option<<T as PolarsDataType>::Physical<'_>>
pub fn last(&self) -> Option<<T as PolarsDataType>::Physical<'_>>
pub fn layout(&self) -> ChunkedArrayLayout<'_, T>
Sourcepub fn cont_slice(
&self,
) -> Result<&[<T as PolarsNumericType>::Native], PolarsError>
pub fn cont_slice( &self, ) -> Result<&[<T as PolarsNumericType>::Native], PolarsError>
Returns the values of the array as a contiguous slice.
Sourcepub fn data_views(&self) -> impl DoubleEndedIterator
pub fn data_views(&self) -> impl DoubleEndedIterator
Get slices of the underlying arrow data. NOTE: null values should be taken into account by the user of these slices as they are handled separately
pub fn into_no_null_iter( &self, ) -> impl Send + Sync + ExactSizeIterator + DoubleEndedIterator + TrustedLen
Sourcepub unsafe fn group_tuples_perfect(
&self,
num_groups: usize,
multithreaded: bool,
group_capacity: usize,
) -> GroupsType
pub unsafe fn group_tuples_perfect( &self, num_groups: usize, multithreaded: bool, group_capacity: usize, ) -> GroupsType
Use the indexes as perfect groups.
§Safety
This ChunkedArray must contain each value in [0..num_groups) at least once, and nothing outside this range.
Sourcepub fn lhs_sub<N>(&self, lhs: N) -> ChunkedArray<T>
pub fn lhs_sub<N>(&self, lhs: N) -> ChunkedArray<T>
Apply lhs - self
Sourcepub fn lhs_div<N>(&self, lhs: N) -> ChunkedArray<T>
pub fn lhs_div<N>(&self, lhs: N) -> ChunkedArray<T>
Apply lhs / self
Sourcepub fn lhs_rem<N>(&self, lhs: N) -> ChunkedArray<T>
pub fn lhs_rem<N>(&self, lhs: N) -> ChunkedArray<T>
Apply lhs % self
Trait Implementations§
Source§impl Add for &Logical<DecimalType, Int128Type>
impl Add for &Logical<DecimalType, Int128Type>
Source§type Output = Result<Logical<DecimalType, Int128Type>, PolarsError>
type Output = Result<Logical<DecimalType, Int128Type>, PolarsError>
+
operator.Source§fn add(
self,
rhs: &Logical<DecimalType, Int128Type>,
) -> <&Logical<DecimalType, Int128Type> as Add>::Output
fn add( self, rhs: &Logical<DecimalType, Int128Type>, ) -> <&Logical<DecimalType, Int128Type> as Add>::Output
+
operation. Read moreSource§impl<K, T> Clone for Logical<K, T>where
K: PolarsDataType,
T: PolarsDataType,
impl<K, T> Clone for Logical<K, T>where
K: PolarsDataType,
T: PolarsDataType,
Source§impl DateMethods for Logical<DateType, Int32Type>
impl DateMethods for Logical<DateType, Int32Type>
fn parse_from_str_slice( name: PlSmallStr, v: &[&str], fmt: &str, ) -> Logical<DateType, Int32Type>
Source§fn year(&self) -> ChunkedArray<Int32Type>
fn year(&self) -> ChunkedArray<Int32Type>
Source§fn is_leap_year(&self) -> ChunkedArray<BooleanType>
fn is_leap_year(&self) -> ChunkedArray<BooleanType>
Source§fn iso_year(&self) -> ChunkedArray<Int32Type>
fn iso_year(&self) -> ChunkedArray<Int32Type>
Source§fn quarter(&self) -> ChunkedArray<Int8Type>
fn quarter(&self) -> ChunkedArray<Int8Type>
Source§fn month(&self) -> ChunkedArray<Int8Type>
fn month(&self) -> ChunkedArray<Int8Type>
Source§fn week(&self) -> ChunkedArray<Int8Type>
fn week(&self) -> ChunkedArray<Int8Type>
Source§fn day(&self) -> ChunkedArray<Int8Type>
fn day(&self) -> ChunkedArray<Int8Type>
Source§fn ordinal(&self) -> ChunkedArray<Int16Type>
fn ordinal(&self) -> ChunkedArray<Int16Type>
Source§fn new_from_parts(
year: &ChunkedArray<Int32Type>,
month: &ChunkedArray<Int8Type>,
day: &ChunkedArray<Int8Type>,
name: PlSmallStr,
) -> Result<Logical<DateType, Int32Type>, PolarsError>
fn new_from_parts( year: &ChunkedArray<Int32Type>, month: &ChunkedArray<Int8Type>, day: &ChunkedArray<Int8Type>, name: PlSmallStr, ) -> Result<Logical<DateType, Int32Type>, PolarsError>
Source§impl DatetimeMethods for Logical<DatetimeType, Int64Type>
impl DatetimeMethods for Logical<DatetimeType, Int64Type>
Source§fn year(&self) -> ChunkedArray<Int32Type>
fn year(&self) -> ChunkedArray<Int32Type>
Source§fn is_leap_year(&self) -> ChunkedArray<BooleanType>
fn is_leap_year(&self) -> ChunkedArray<BooleanType>
fn iso_year(&self) -> ChunkedArray<Int32Type>
Source§fn quarter(&self) -> ChunkedArray<Int8Type>
fn quarter(&self) -> ChunkedArray<Int8Type>
Source§fn month(&self) -> ChunkedArray<Int8Type>
fn month(&self) -> ChunkedArray<Int8Type>
Source§fn weekday(&self) -> ChunkedArray<Int8Type>
fn weekday(&self) -> ChunkedArray<Int8Type>
Source§fn week(&self) -> ChunkedArray<Int8Type>
fn week(&self) -> ChunkedArray<Int8Type>
Source§fn day(&self) -> ChunkedArray<Int8Type>
fn day(&self) -> ChunkedArray<Int8Type>
Source§fn hour(&self) -> ChunkedArray<Int8Type>
fn hour(&self) -> ChunkedArray<Int8Type>
Source§fn minute(&self) -> ChunkedArray<Int8Type>
fn minute(&self) -> ChunkedArray<Int8Type>
Source§fn second(&self) -> ChunkedArray<Int8Type>
fn second(&self) -> ChunkedArray<Int8Type>
Source§fn nanosecond(&self) -> ChunkedArray<Int32Type>
fn nanosecond(&self) -> ChunkedArray<Int32Type>
Source§fn ordinal(&self) -> ChunkedArray<Int16Type>
fn ordinal(&self) -> ChunkedArray<Int16Type>
fn parse_from_str_slice( name: PlSmallStr, v: &[&str], fmt: &str, tu: TimeUnit, ) -> Logical<DatetimeType, Int64Type>
Source§fn new_from_parts(
year: &ChunkedArray<Int32Type>,
month: &ChunkedArray<Int8Type>,
day: &ChunkedArray<Int8Type>,
hour: &ChunkedArray<Int8Type>,
minute: &ChunkedArray<Int8Type>,
second: &ChunkedArray<Int8Type>,
nanosecond: &ChunkedArray<Int32Type>,
ambiguous: &ChunkedArray<StringType>,
time_unit: &TimeUnit,
time_zone: Option<&str>,
name: PlSmallStr,
) -> Result<Logical<DatetimeType, Int64Type>, PolarsError>
fn new_from_parts( year: &ChunkedArray<Int32Type>, month: &ChunkedArray<Int8Type>, day: &ChunkedArray<Int8Type>, hour: &ChunkedArray<Int8Type>, minute: &ChunkedArray<Int8Type>, second: &ChunkedArray<Int8Type>, nanosecond: &ChunkedArray<Int32Type>, ambiguous: &ChunkedArray<StringType>, time_unit: &TimeUnit, time_zone: Option<&str>, name: PlSmallStr, ) -> Result<Logical<DatetimeType, Int64Type>, PolarsError>
Source§impl<K, T> Default for Logical<K, T>where
K: PolarsDataType,
T: PolarsDataType,
impl<K, T> Default for Logical<K, T>where
K: PolarsDataType,
T: PolarsDataType,
Source§impl<K, T> Deref for Logical<K, T>where
K: PolarsDataType,
T: PolarsDataType,
impl<K, T> Deref for Logical<K, T>where
K: PolarsDataType,
T: PolarsDataType,
Source§impl<K, T> DerefMut for Logical<K, T>where
K: PolarsDataType,
T: PolarsDataType,
impl<K, T> DerefMut for Logical<K, T>where
K: PolarsDataType,
T: PolarsDataType,
Source§impl Div for &Logical<DecimalType, Int128Type>
impl Div for &Logical<DecimalType, Int128Type>
Source§type Output = Result<Logical<DecimalType, Int128Type>, PolarsError>
type Output = Result<Logical<DecimalType, Int128Type>, PolarsError>
/
operator.Source§fn div(
self,
rhs: &Logical<DecimalType, Int128Type>,
) -> <&Logical<DecimalType, Int128Type> as Div>::Output
fn div( self, rhs: &Logical<DecimalType, Int128Type>, ) -> <&Logical<DecimalType, Int128Type> as Div>::Output
/
operation. Read moreSource§impl DurationMethods for Logical<DurationType, Int64Type>
impl DurationMethods for Logical<DurationType, Int64Type>
Source§fn hours(&self) -> ChunkedArray<Int64Type>
fn hours(&self) -> ChunkedArray<Int64Type>
Extract the hours from a Duration
Source§fn days(&self) -> ChunkedArray<Int64Type>
fn days(&self) -> ChunkedArray<Int64Type>
Extract the days from a Duration
Source§fn minutes(&self) -> ChunkedArray<Int64Type>
fn minutes(&self) -> ChunkedArray<Int64Type>
Extract the seconds from a Duration
Source§fn seconds(&self) -> ChunkedArray<Int64Type>
fn seconds(&self) -> ChunkedArray<Int64Type>
Extract the seconds from a Duration
Source§fn milliseconds(&self) -> ChunkedArray<Int64Type>
fn milliseconds(&self) -> ChunkedArray<Int64Type>
Extract the milliseconds from a Duration
Source§fn microseconds(&self) -> ChunkedArray<Int64Type>
fn microseconds(&self) -> ChunkedArray<Int64Type>
Extract the microseconds from a Duration
Source§fn nanoseconds(&self) -> ChunkedArray<Int64Type>
fn nanoseconds(&self) -> ChunkedArray<Int64Type>
Extract the nanoseconds from a Duration
Source§impl IntoSeries for Logical<DatetimeType, Int64Type>
impl IntoSeries for Logical<DatetimeType, Int64Type>
Source§impl IntoSeries for Logical<DecimalType, Int128Type>
impl IntoSeries for Logical<DecimalType, Int128Type>
Source§impl IntoSeries for Logical<DurationType, Int64Type>
impl IntoSeries for Logical<DurationType, Int64Type>
Source§impl LogicalType for Logical<DateType, Int32Type>
impl LogicalType for Logical<DateType, Int32Type>
Source§fn dtype(&self) -> &DataType
fn dtype(&self) -> &DataType
ChunkedArray
.Source§fn get_any_value(&self, i: usize) -> Result<AnyValue<'_>, PolarsError>
fn get_any_value(&self, i: usize) -> Result<AnyValue<'_>, PolarsError>
AnyValue
from LogicalType
fn cast_with_options( &self, dtype: &DataType, cast_options: CastOptions, ) -> Result<Series, PolarsError>
fn cast(&self, dtype: &DataType) -> Result<Series, PolarsError>
Source§impl LogicalType for Logical<DatetimeType, Int64Type>
impl LogicalType for Logical<DatetimeType, Int64Type>
Source§fn dtype(&self) -> &DataType
fn dtype(&self) -> &DataType
ChunkedArray
.Source§fn get_any_value(&self, i: usize) -> Result<AnyValue<'_>, PolarsError>
fn get_any_value(&self, i: usize) -> Result<AnyValue<'_>, PolarsError>
AnyValue
from LogicalType
fn cast_with_options( &self, dtype: &DataType, cast_options: CastOptions, ) -> Result<Series, PolarsError>
fn cast(&self, dtype: &DataType) -> Result<Series, PolarsError>
Source§impl LogicalType for Logical<DecimalType, Int128Type>
impl LogicalType for Logical<DecimalType, Int128Type>
Source§fn dtype(&self) -> &DataType
fn dtype(&self) -> &DataType
ChunkedArray
.Source§fn get_any_value(&self, i: usize) -> Result<AnyValue<'_>, PolarsError>
fn get_any_value(&self, i: usize) -> Result<AnyValue<'_>, PolarsError>
AnyValue
from LogicalType
fn cast_with_options( &self, dtype: &DataType, cast_options: CastOptions, ) -> Result<Series, PolarsError>
fn cast(&self, dtype: &DataType) -> Result<Series, PolarsError>
Source§impl LogicalType for Logical<DurationType, Int64Type>
impl LogicalType for Logical<DurationType, Int64Type>
Source§fn dtype(&self) -> &DataType
fn dtype(&self) -> &DataType
ChunkedArray
.Source§fn get_any_value(&self, i: usize) -> Result<AnyValue<'_>, PolarsError>
fn get_any_value(&self, i: usize) -> Result<AnyValue<'_>, PolarsError>
AnyValue
from LogicalType
fn cast_with_options( &self, dtype: &DataType, cast_options: CastOptions, ) -> Result<Series, PolarsError>
fn cast(&self, dtype: &DataType) -> Result<Series, PolarsError>
Source§impl LogicalType for Logical<TimeType, Int64Type>
impl LogicalType for Logical<TimeType, Int64Type>
Source§fn dtype(&self) -> &'static DataType
fn dtype(&self) -> &'static DataType
ChunkedArray
.Source§fn get_any_value(&self, i: usize) -> Result<AnyValue<'_>, PolarsError>
fn get_any_value(&self, i: usize) -> Result<AnyValue<'_>, PolarsError>
AnyValue
from LogicalType
fn cast_with_options( &self, dtype: &DataType, cast_options: CastOptions, ) -> Result<Series, PolarsError>
fn cast(&self, dtype: &DataType) -> Result<Series, PolarsError>
Source§impl Mul for &Logical<DecimalType, Int128Type>
impl Mul for &Logical<DecimalType, Int128Type>
Source§type Output = Result<Logical<DecimalType, Int128Type>, PolarsError>
type Output = Result<Logical<DecimalType, Int128Type>, PolarsError>
*
operator.Source§fn mul(
self,
rhs: &Logical<DecimalType, Int128Type>,
) -> <&Logical<DecimalType, Int128Type> as Mul>::Output
fn mul( self, rhs: &Logical<DecimalType, Int128Type>, ) -> <&Logical<DecimalType, Int128Type> as Mul>::Output
*
operation. Read moreSource§impl<T> NamedFrom<T, [NaiveDateTime]> for Logical<DatetimeType, Int64Type>where
T: AsRef<[NaiveDateTime]>,
impl<T> NamedFrom<T, [NaiveDateTime]> for Logical<DatetimeType, Int64Type>where
T: AsRef<[NaiveDateTime]>,
Source§fn new(name: PlSmallStr, v: T) -> Logical<DatetimeType, Int64Type>
fn new(name: PlSmallStr, v: T) -> Logical<DatetimeType, Int64Type>
Source§impl<T> NamedFrom<T, [Option<NaiveDateTime>]> for Logical<DatetimeType, Int64Type>
impl<T> NamedFrom<T, [Option<NaiveDateTime>]> for Logical<DatetimeType, Int64Type>
Source§fn new(name: PlSmallStr, v: T) -> Logical<DatetimeType, Int64Type>
fn new(name: PlSmallStr, v: T) -> Logical<DatetimeType, Int64Type>
Source§impl<T> NamedFrom<T, [Option<TimeDelta>]> for Logical<DurationType, Int64Type>
impl<T> NamedFrom<T, [Option<TimeDelta>]> for Logical<DurationType, Int64Type>
Source§fn new(name: PlSmallStr, v: T) -> Logical<DurationType, Int64Type>
fn new(name: PlSmallStr, v: T) -> Logical<DurationType, Int64Type>
Source§impl<T> NamedFrom<T, [TimeDelta]> for Logical<DurationType, Int64Type>
impl<T> NamedFrom<T, [TimeDelta]> for Logical<DurationType, Int64Type>
Source§fn new(name: PlSmallStr, v: T) -> Logical<DurationType, Int64Type>
fn new(name: PlSmallStr, v: T) -> Logical<DurationType, Int64Type>
Source§impl PolarsRound for Logical<DateType, Int32Type>
impl PolarsRound for Logical<DateType, Int32Type>
fn round( &self, every: &ChunkedArray<StringType>, _tz: Option<&Tz>, ) -> Result<Logical<DateType, Int32Type>, PolarsError>
Source§impl PolarsRound for Logical<DatetimeType, Int64Type>
impl PolarsRound for Logical<DatetimeType, Int64Type>
fn round( &self, every: &ChunkedArray<StringType>, tz: Option<&Tz>, ) -> Result<Logical<DatetimeType, Int64Type>, PolarsError>
Source§impl PolarsTruncate for Logical<DateType, Int32Type>
impl PolarsTruncate for Logical<DateType, Int32Type>
fn truncate( &self, _tz: Option<&Tz>, every: &ChunkedArray<StringType>, ) -> Result<Logical<DateType, Int32Type>, PolarsError>
Source§impl PolarsTruncate for Logical<DatetimeType, Int64Type>
impl PolarsTruncate for Logical<DatetimeType, Int64Type>
fn truncate( &self, tz: Option<&Tz>, every: &ChunkedArray<StringType>, ) -> Result<Logical<DatetimeType, Int64Type>, PolarsError>
Source§impl Sub for &Logical<DecimalType, Int128Type>
impl Sub for &Logical<DecimalType, Int128Type>
Source§type Output = Result<Logical<DecimalType, Int128Type>, PolarsError>
type Output = Result<Logical<DecimalType, Int128Type>, PolarsError>
-
operator.Source§fn sub(
self,
rhs: &Logical<DecimalType, Int128Type>,
) -> <&Logical<DecimalType, Int128Type> as Sub>::Output
fn sub( self, rhs: &Logical<DecimalType, Int128Type>, ) -> <&Logical<DecimalType, Int128Type> as Sub>::Output
-
operation. Read moreSource§impl TimeMethods for Logical<TimeType, Int64Type>
impl TimeMethods for Logical<TimeType, Int64Type>
Source§fn hour(&self) -> ChunkedArray<Int8Type>
fn hour(&self) -> ChunkedArray<Int8Type>
Extract hour from underlying NaiveDateTime representation. Returns the hour number from 0 to 23.
Source§fn minute(&self) -> ChunkedArray<Int8Type>
fn minute(&self) -> ChunkedArray<Int8Type>
Extract minute from underlying NaiveDateTime representation. Returns the minute number from 0 to 59.
Source§fn second(&self) -> ChunkedArray<Int8Type>
fn second(&self) -> ChunkedArray<Int8Type>
Extract second from underlying NaiveDateTime representation. Returns the second number from 0 to 59.
Source§fn nanosecond(&self) -> ChunkedArray<Int32Type>
fn nanosecond(&self) -> ChunkedArray<Int32Type>
Extract second from underlying NaiveDateTime representation. Returns the number of nanoseconds since the whole non-leap second. The range from 1,000,000,000 to 1,999,999,999 represents the leap second.
fn parse_from_str_slice( name: PlSmallStr, v: &[&str], fmt: &str, ) -> Logical<TimeType, Int64Type>
Auto Trait Implementations§
impl<Logical, Physical> !Freeze for Logical<Logical, Physical>
impl<Logical, Physical> !RefUnwindSafe for Logical<Logical, Physical>
impl<Logical, Physical> Send for Logical<Logical, Physical>
impl<Logical, Physical> Sync for Logical<Logical, Physical>
impl<Logical, Physical> Unpin for Logical<Logical, Physical>
impl<Logical, Physical> !UnwindSafe for Logical<Logical, Physical>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoColumn for Twhere
T: IntoSeries,
impl<T> IntoColumn for Twhere
T: IntoSeries,
fn into_column(self) -> Column
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more