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>
Available on crate feature timezones
only.
pub fn set_time_zone( &mut self, time_zone: PlSmallStr, ) -> Result<(), PolarsError>
timezones
only.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>
Available on crate feature timezones
only.
pub fn set_time_unit_and_time_zone( &mut self, time_unit: TimeUnit, time_zone: PlSmallStr, ) -> Result<(), PolarsError>
timezones
only.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>>§
pub fn sum(&self) -> Option<u32>
pub fn min(&self) -> Option<bool>
pub fn max(&self) -> Option<bool>
pub fn mean(&self) -> Option<f64>
pub fn max_binary(&self) -> Option<&[u8]>
pub fn min_binary(&self) -> Option<&[u8]>
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 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)
pub fn apply_mut<'a, F>(&'a self, f: F) -> ChunkedArray<StringType>
pub fn apply_mut<'a, F>(&'a self, f: F) -> ChunkedArray<BinaryType>
Sourcepub unsafe fn apply_views<F>(&self, update_view: F) -> ChunkedArray<StringType>
pub unsafe fn apply_views<F>(&self, update_view: F) -> ChunkedArray<StringType>
§Safety
Update the views. All invariants of the views apply.
pub fn apply_as_ints<F>(&self, f: F) -> Series
pub fn apply_as_ints<F>(&self, f: F) -> Series
pub fn num_trues(&self) -> usize
pub fn num_falses(&self) -> usize
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: u32)
pub unsafe fn set_null_count(&mut self, null_count: u32)
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.
pub fn rechunk(&self) -> ChunkedArray<T>
pub fn rechunk_validity(&self) -> 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 to_decimal(&self, infer_length: usize) -> Result<Series, PolarsError>
pub fn to_decimal(&self, infer_length: usize) -> Result<Series, PolarsError>
Convert an StringChunked
to a Series
of DataType::Decimal
.
Scale needed for the decimal type are inferred. Parsing is not strict.
Scale inference assumes that all tested strings are well-formed numbers,
and may produce unexpected results for scale if this is not the case.
If the decimal precision
and scale
are already known, consider
using the cast
method.
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.
Sourcepub unsafe fn to_string_unchecked(&self) -> ChunkedArray<StringType>
pub unsafe fn to_string_unchecked(&self) -> ChunkedArray<StringType>
§Safety
String is not validated
pub fn as_binary(&self) -> ChunkedArray<BinaryType>
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.
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 par_iter(&self) -> impl ParallelIterator<Item = Option<Series>>
pub fn par_iter_indexed(&mut self) -> impl IndexedParallelIterator
pub fn par_iter_indexed(&self) -> impl IndexedParallelIterator
pub fn par_iter(&self) -> impl ParallelIterator<Item = Option<&str>>
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
Sourcepub fn to_ndarray<N>(
&self,
) -> Result<ArrayBase<OwnedRepr<<N as PolarsNumericType>::Native>, Dim<[usize; 2]>>, PolarsError>where
N: PolarsNumericType,
pub fn to_ndarray<N>(
&self,
) -> Result<ArrayBase<OwnedRepr<<N as PolarsNumericType>::Native>, Dim<[usize; 2]>>, PolarsError>where
N: PolarsNumericType,
If all nested Series
have the same length, a 2 dimensional ndarray::Array
is returned.
Sourcepub fn amortized_iter(
&self,
) -> AmortizedListIter<'_, impl Iterator<Item = Option<Box<dyn Array>>>>
pub fn amortized_iter( &self, ) -> AmortizedListIter<'_, impl Iterator<Item = Option<Box<dyn Array>>>>
This is an iterator over a ArrayChunked
that save allocations.
A Series is:
1. Arc<ChunkedArray>
ChunkedArray is:
2. Vec< 3. ArrayRef>
The ArrayRef
we indicated with 3. will be updated during iteration.
The Series will be pinned in memory, saving an allocation for
- Arc<..>
- Vec<…>
§Warning
Though memory safe in the sense that it will not read unowned memory, UB, or memory leaks
this function still needs precautions. The returned should never be cloned or taken longer
than a single iteration, as every call on next
of the iterator will change the contents of
that Series.
§Safety
The lifetime of AmortSeries is bound to the iterator. Keeping it alive longer than the iterator is UB.
Sourcepub fn amortized_iter_with_name(
&self,
name: PlSmallStr,
) -> AmortizedListIter<'_, impl Iterator<Item = Option<Box<dyn Array>>>>
pub fn amortized_iter_with_name( &self, name: PlSmallStr, ) -> AmortizedListIter<'_, impl Iterator<Item = Option<Box<dyn Array>>>>
This is an iterator over a ArrayChunked
that save allocations.
A Series is:
1. Arc<ChunkedArray>
ChunkedArray is:
2. Vec< 3. ArrayRef>
The ArrayRef we indicated with 3. will be updated during iteration. The Series will be pinned in memory, saving an allocation for
- Arc<..>
- Vec<…>
If the returned AmortSeries
is cloned, the local copy will be replaced and a new container
will be set.
pub fn try_apply_amortized_to_list<F>( &self, f: F, ) -> Result<ChunkedArray<ListType>, PolarsError>
Sourcepub unsafe fn apply_amortized_same_type<F>(
&self,
f: F,
) -> ChunkedArray<FixedSizeListType>
pub unsafe fn apply_amortized_same_type<F>( &self, f: F, ) -> ChunkedArray<FixedSizeListType>
Apply a closure F
to each array.
§Safety
Return series of F
must has the same dtype and number of elements as input.
Sourcepub unsafe fn try_apply_amortized_same_type<F>(
&self,
f: F,
) -> Result<ChunkedArray<FixedSizeListType>, PolarsError>
pub unsafe fn try_apply_amortized_same_type<F>( &self, f: F, ) -> Result<ChunkedArray<FixedSizeListType>, PolarsError>
Try apply a closure F
to each array.
§Safety
Return series of F
must has the same dtype and number of elements as input if it is Ok.
Sourcepub unsafe fn zip_and_apply_amortized_same_type<'a, T, F>(
&'a self,
ca: &'a ChunkedArray<T>,
f: F,
) -> ChunkedArray<FixedSizeListType>where
T: PolarsDataType,
F: FnMut(Option<AmortSeries>, Option<<T as PolarsDataType>::Physical<'a>>) -> Option<Series>,
pub unsafe fn zip_and_apply_amortized_same_type<'a, T, F>(
&'a self,
ca: &'a ChunkedArray<T>,
f: F,
) -> ChunkedArray<FixedSizeListType>where
T: PolarsDataType,
F: FnMut(Option<AmortSeries>, Option<<T as PolarsDataType>::Physical<'a>>) -> Option<Series>,
Zip with a ChunkedArray
then apply a binary function F
elementwise.
§Safety
Sourcepub fn apply_amortized_generic<F, K, V>(&self, f: F) -> ChunkedArray<V>where
V: PolarsDataType,
F: FnMut(Option<AmortSeries>) -> Option<K> + Copy,
<V as PolarsDataType>::Array: ArrayFromIter<Option<K>>,
pub fn apply_amortized_generic<F, K, V>(&self, f: F) -> ChunkedArray<V>where
V: PolarsDataType,
F: FnMut(Option<AmortSeries>) -> Option<K> + Copy,
<V as PolarsDataType>::Array: ArrayFromIter<Option<K>>,
Apply a closure F
elementwise.
Sourcepub fn try_apply_amortized_generic<F, K, V>(
&self,
f: F,
) -> Result<ChunkedArray<V>, PolarsError>where
V: PolarsDataType,
F: FnMut(Option<AmortSeries>) -> Result<Option<K>, PolarsError> + Copy,
<V as PolarsDataType>::Array: ArrayFromIter<Option<K>>,
pub fn try_apply_amortized_generic<F, K, V>(
&self,
f: F,
) -> Result<ChunkedArray<V>, PolarsError>where
V: PolarsDataType,
F: FnMut(Option<AmortSeries>) -> Result<Option<K>, PolarsError> + Copy,
<V as PolarsDataType>::Array: ArrayFromIter<Option<K>>,
Try apply a closure F
elementwise.
pub fn for_each_amortized<F>(&self, f: F)
Sourcepub fn inner_dtype(&self) -> &DataType
pub fn inner_dtype(&self) -> &DataType
Get the inner data type of the fixed size list.
pub fn width(&self) -> usize
Sourcepub unsafe fn to_logical(&mut self, inner_dtype: DataType)
pub unsafe fn to_logical(&mut self, inner_dtype: DataType)
§Safety
The caller must ensure that the logical type given fits the physical type of the array.
Sourcepub fn apply_to_inner(
&self,
func: &dyn Fn(Series) -> Result<Series, PolarsError>,
) -> Result<ChunkedArray<FixedSizeListType>, PolarsError>
pub fn apply_to_inner( &self, func: &dyn Fn(Series) -> Result<Series, PolarsError>, ) -> Result<ChunkedArray<FixedSizeListType>, PolarsError>
Ignore the list indices and apply func
to the inner type as Series
.
Sourcepub fn get_leaf_array(&self) -> Series
pub fn get_leaf_array(&self) -> Series
Recurse nested types until we are at the leaf array.
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 amortized_iter(
&self,
) -> AmortizedListIter<'_, impl Iterator<Item = Option<Box<dyn Array>>>>
pub fn amortized_iter( &self, ) -> AmortizedListIter<'_, impl Iterator<Item = Option<Box<dyn Array>>>>
This is an iterator over a ListChunked
that saves allocations.
A Series is:
1. Arc<ChunkedArray>
ChunkedArray is:
2. Vec< 3. ArrayRef>
The ArrayRef we indicated with 3. will be updated during iteration. The Series will be pinned in memory, saving an allocation for
- Arc<..>
- Vec<…>
If the returned AmortSeries
is cloned, the local copy will be replaced and a new container
will be set.
Sourcepub fn amortized_iter_with_name(
&self,
name: PlSmallStr,
) -> AmortizedListIter<'_, impl Iterator<Item = Option<Box<dyn Array>>>>
pub fn amortized_iter_with_name( &self, name: PlSmallStr, ) -> AmortizedListIter<'_, impl Iterator<Item = Option<Box<dyn Array>>>>
See amortized_iter
.
Sourcepub fn apply_amortized_generic<F, K, V>(&self, f: F) -> ChunkedArray<V>where
V: PolarsDataType,
F: FnMut(Option<AmortSeries>) -> Option<K> + Copy,
<V as PolarsDataType>::Array: ArrayFromIter<Option<K>>,
pub fn apply_amortized_generic<F, K, V>(&self, f: F) -> ChunkedArray<V>where
V: PolarsDataType,
F: FnMut(Option<AmortSeries>) -> Option<K> + Copy,
<V as PolarsDataType>::Array: ArrayFromIter<Option<K>>,
Apply a closure F
elementwise.
pub fn try_apply_amortized_generic<F, K, V>(
&self,
f: F,
) -> Result<ChunkedArray<V>, PolarsError>where
V: PolarsDataType,
F: FnMut(Option<AmortSeries>) -> Result<Option<K>, PolarsError> + Copy,
<V as PolarsDataType>::Array: ArrayFromIter<Option<K>>,
pub fn for_each_amortized<F>(&self, f: F)
Sourcepub fn zip_and_apply_amortized<'a, T, I, F>(
&'a self,
ca: &'a ChunkedArray<T>,
f: F,
) -> ChunkedArray<ListType>where
T: PolarsDataType,
&'a ChunkedArray<T>: IntoIterator<IntoIter = I>,
I: TrustedLen<Item = Option<<T as PolarsDataType>::Physical<'a>>>,
F: FnMut(Option<AmortSeries>, Option<<T as PolarsDataType>::Physical<'a>>) -> Option<Series>,
pub fn zip_and_apply_amortized<'a, T, I, F>(
&'a self,
ca: &'a ChunkedArray<T>,
f: F,
) -> ChunkedArray<ListType>where
T: PolarsDataType,
&'a ChunkedArray<T>: IntoIterator<IntoIter = I>,
I: TrustedLen<Item = Option<<T as PolarsDataType>::Physical<'a>>>,
F: FnMut(Option<AmortSeries>, Option<<T as PolarsDataType>::Physical<'a>>) -> Option<Series>,
Zip with a ChunkedArray
then apply a binary function F
elementwise.
pub fn binary_zip_and_apply_amortized<'a, T, U, F>(
&'a self,
ca1: &'a ChunkedArray<T>,
ca2: &'a ChunkedArray<U>,
f: F,
) -> ChunkedArray<ListType>where
T: PolarsDataType,
U: PolarsDataType,
F: FnMut(Option<AmortSeries>, Option<<T as PolarsDataType>::Physical<'a>>, Option<<U as PolarsDataType>::Physical<'a>>) -> Option<Series>,
pub fn try_zip_and_apply_amortized<'a, T, I, F>(
&'a self,
ca: &'a ChunkedArray<T>,
f: F,
) -> Result<ChunkedArray<ListType>, PolarsError>where
T: PolarsDataType,
&'a ChunkedArray<T>: IntoIterator<IntoIter = I>,
I: TrustedLen<Item = Option<<T as PolarsDataType>::Physical<'a>>>,
F: FnMut(Option<AmortSeries>, Option<<T as PolarsDataType>::Physical<'a>>) -> Result<Option<Series>, PolarsError>,
Sourcepub fn apply_amortized<F>(&self, f: F) -> ChunkedArray<ListType>
pub fn apply_amortized<F>(&self, f: F) -> ChunkedArray<ListType>
Apply a closure F
elementwise.
pub fn try_apply_amortized<F>( &self, f: F, ) -> Result<ChunkedArray<ListType>, PolarsError>
Sourcepub fn inner_dtype(&self) -> &DataType
pub fn inner_dtype(&self) -> &DataType
Get the inner data type of the list.
pub fn set_inner_dtype(&mut self, dtype: DataType)
pub fn set_fast_explode(&mut self)
pub fn _can_fast_explode(&self) -> bool
Sourcepub unsafe fn to_logical(&mut self, inner_dtype: DataType)
pub unsafe fn to_logical(&mut self, inner_dtype: DataType)
Set the logical type of the ListChunked
.
§Safety
The caller must ensure that the logical type given fits the physical type of the array.
Sourcepub fn apply_to_inner(
&self,
func: &dyn Fn(Series) -> Result<Series, PolarsError>,
) -> Result<ChunkedArray<ListType>, PolarsError>
pub fn apply_to_inner( &self, func: &dyn Fn(Series) -> Result<Series, PolarsError>, ) -> Result<ChunkedArray<ListType>, PolarsError>
Ignore the list indices and apply func
to the inner type as Series
.
pub fn rechunk_and_trim_to_normalized_offsets(&self) -> ChunkedArray<ListType>
Sourcepub unsafe fn get_object_unchecked(
&self,
index: usize,
) -> Option<&(dyn PolarsObjectSafe + 'static)>
pub unsafe fn get_object_unchecked( &self, index: usize, ) -> Option<&(dyn PolarsObjectSafe + 'static)>
Get a hold to an object that can be formatted or downcasted via the Any trait.
§Safety
No bounds checks
Sourcepub fn get_object(
&self,
index: usize,
) -> Option<&(dyn PolarsObjectSafe + 'static)>
pub fn get_object( &self, index: usize, ) -> Option<&(dyn PolarsObjectSafe + 'static)>
Get a hold to an object that can be formatted or downcasted via the Any trait.
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
.
pub fn struct_fields(&self) -> &[Field]
pub fn fields_as_series(&self) -> Vec<Series>
pub fn cast_with_options( &self, dtype: &DataType, cast_options: CastOptions, ) -> Result<Series, PolarsError>
pub fn cast(&self, dtype: &DataType) -> Result<Series, PolarsError>
pub fn _apply_fields<F>( &self, func: F, ) -> Result<ChunkedArray<StructType>, PolarsError>
pub fn try_apply_fields<F>( &self, func: F, ) -> Result<ChunkedArray<StructType>, PolarsError>
pub fn get_row_encoded_array( &self, options: SortOptions, ) -> Result<BinaryArray<i64>, PolarsError>
pub fn get_row_encoded( &self, options: SortOptions, ) -> Result<ChunkedArray<BinaryOffsetType>, PolarsError>
Sourcepub fn zip_outer_validity(&mut self, other: &ChunkedArray<StructType>)
pub fn zip_outer_validity(&mut self, other: &ChunkedArray<StructType>)
Combine the validities of two structs.
Sourcepub fn field_by_name(&self, name: &str) -> Result<Series, PolarsError>
pub fn field_by_name(&self, name: &str) -> Result<Series, PolarsError>
Get access to one of this StructChunked
’s fields
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 metadata_dyn(&self) -> Option<RwLockReadGuard<'_, dyn MetadataTrait>>
pub fn metadata_dyn(&self) -> Option<RwLockReadGuard<'_, dyn MetadataTrait>>
Attempt to get a reference to the trait object containing the ChunkedArray
’s Metadata
This fails if there is a need to block.
Sourcepub fn boxed_metadata_dyn<'a>(&'a self) -> Box<dyn MetadataTrait + 'a>
pub fn boxed_metadata_dyn<'a>(&'a self) -> Box<dyn MetadataTrait + 'a>
Attempt to get a reference to the trait object containing the ChunkedArray
’s Metadata
This fails if there is a need to block.
Sourcepub fn metadata(&self) -> MetadataReadGuard<'_, T>
pub fn metadata(&self) -> MetadataReadGuard<'_, T>
Get a guard to read the ChunkedArray
’s Metadata
Sourcepub fn interior_mut_metadata(&self) -> RwLockWriteGuard<'_, Metadata<T>>
pub fn interior_mut_metadata(&self) -> RwLockWriteGuard<'_, Metadata<T>>
Get a guard to read/write the ChunkedArray
’s Metadata
Sourcepub fn metadata_arc(&self) -> &Arc<IMMetadata<T>>
pub fn metadata_arc(&self) -> &Arc<IMMetadata<T>>
Get a reference to Arc
that contains the ChunkedArray
’s Metadata
Sourcepub fn metadata_owned_arc(&self) -> Arc<IMMetadata<T>>
pub fn metadata_owned_arc(&self) -> Arc<IMMetadata<T>>
Get a Arc
that contains the ChunkedArray
’s Metadata
Sourcepub fn metadata_mut(&mut self) -> &mut Arc<IMMetadata<T>>
pub fn metadata_mut(&mut self) -> &mut Arc<IMMetadata<T>>
Get a mutable reference to the Arc
that contains the ChunkedArray
’s Metadata
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) -> MetadataFlags
pub fn is_sorted_flag(&self) -> IsSorted
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.
pub fn get_min_value(&self) -> Option<<T as PolarsDataType>::OwnedPhysical>
pub fn get_max_value(&self) -> Option<<T as PolarsDataType>::OwnedPhysical>
pub fn get_distinct_count(&self) -> Option<u32>
pub fn merge_metadata(&mut self, md: Metadata<T>)
Sourcepub fn copy_metadata_cast<O>(
&mut self,
other: &ChunkedArray<O>,
props: MetadataProperties,
)where
O: PolarsDataType,
pub fn copy_metadata_cast<O>(
&mut self,
other: &ChunkedArray<O>,
props: MetadataProperties,
)where
O: PolarsDataType,
Copies Metadata
properties specified by props
from other
with different underlying PolarsDataType
into
self
.
This does not copy the properties with a different type between the Metadata
s (e.g.
min_value
and max_value
) and will panic on debug builds if that is attempted.
Sourcepub fn copy_metadata(
&mut self,
other: &ChunkedArray<T>,
props: MetadataProperties,
)
pub fn copy_metadata( &mut self, other: &ChunkedArray<T>, props: MetadataProperties, )
Copies Metadata
properties specified by props
from other
into self
.
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 unpack_series_matching_type(
&self,
series: &Series,
) -> Result<&ChunkedArray<T>, PolarsError>
pub fn unpack_series_matching_type( &self, series: &Series, ) -> Result<&ChunkedArray<T>, PolarsError>
Series to 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 get_as_series(&self, idx: usize) -> Option<Series>
pub fn get_as_series(&self, idx: usize) -> Option<Series>
dtype-array
only.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,
) -> GroupsProxy
pub unsafe fn group_tuples_perfect( &self, num_groups: usize, multithreaded: bool, group_capacity: usize, ) -> GroupsProxy
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§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§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 From<Logical<DateType, Int32Type>> for Series
Available on crate feature dtype-date
only.
impl From<Logical<DateType, Int32Type>> for Series
dtype-date
only.Source§impl From<Logical<DatetimeType, Int64Type>> for Series
Available on crate feature dtype-datetime
only.
impl From<Logical<DatetimeType, Int64Type>> for Series
dtype-datetime
only.Source§impl From<Logical<DurationType, Int64Type>> for Series
Available on crate feature dtype-duration
only.
impl From<Logical<DurationType, Int64Type>> for Series
dtype-duration
only.Source§impl From<Logical<TimeType, Int64Type>> for Series
Available on crate feature dtype-time
only.
impl From<Logical<TimeType, Int64Type>> for Series
dtype-time
only.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, [NaiveDate]> for Logical<DateType, Int32Type>
Available on crate feature dtype-date
only.
impl<T> NamedFrom<T, [NaiveDate]> for Logical<DateType, Int32Type>
dtype-date
only.Source§impl<T> NamedFrom<T, [NaiveDateTime]> for Logical<DatetimeType, Int64Type>where
T: AsRef<[NaiveDateTime]>,
Available on crate feature dtype-datetime
only.
impl<T> NamedFrom<T, [NaiveDateTime]> for Logical<DatetimeType, Int64Type>where
T: AsRef<[NaiveDateTime]>,
dtype-datetime
only.Source§fn new(name: PlSmallStr, v: T) -> Logical<DatetimeType, Int64Type>
fn new(name: PlSmallStr, v: T) -> Logical<DatetimeType, Int64Type>
Source§impl<T> NamedFrom<T, [NaiveTime]> for Logical<TimeType, Int64Type>
Available on crate feature dtype-time
only.
impl<T> NamedFrom<T, [NaiveTime]> for Logical<TimeType, Int64Type>
dtype-time
only.Source§impl<T> NamedFrom<T, [Option<NaiveDate>]> for Logical<DateType, Int32Type>
Available on crate feature dtype-date
only.
impl<T> NamedFrom<T, [Option<NaiveDate>]> for Logical<DateType, Int32Type>
dtype-date
only.Source§impl<T> NamedFrom<T, [Option<NaiveDateTime>]> for Logical<DatetimeType, Int64Type>
Available on crate feature dtype-datetime
only.
impl<T> NamedFrom<T, [Option<NaiveDateTime>]> for Logical<DatetimeType, Int64Type>
dtype-datetime
only.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<NaiveTime>]> for Logical<TimeType, Int64Type>
Available on crate feature dtype-time
only.
impl<T> NamedFrom<T, [Option<NaiveTime>]> for Logical<TimeType, Int64Type>
dtype-time
only.Source§impl<T> NamedFrom<T, [Option<TimeDelta>]> for Logical<DurationType, Int64Type>
Available on crate feature dtype-duration
only.
impl<T> NamedFrom<T, [Option<TimeDelta>]> for Logical<DurationType, Int64Type>
dtype-duration
only.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>
Available on crate feature dtype-duration
only.
impl<T> NamedFrom<T, [TimeDelta]> for Logical<DurationType, Int64Type>
dtype-duration
only.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<K, T> Serialize for Logical<K, T>where
K: PolarsDataType,
T: PolarsNumericType,
Logical<K, T>: LogicalType,
ChunkedArray<T>: Serialize,
<T as PolarsNumericType>::Native: Serialize,
impl<K, T> Serialize for Logical<K, T>where
K: PolarsDataType,
T: PolarsNumericType,
Logical<K, T>: LogicalType,
ChunkedArray<T>: Serialize,
<T as PolarsNumericType>::Native: Serialize,
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
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>where
Logical: Unpin,
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,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§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