pub struct Logical<Logical, Physical>(pub ChunkedArray<Physical>, _, pub Option<DataType>)
where
Logical: PolarsDataType,
Physical: PolarsDataType;
Expand description
Maps a logical type to a 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
sourceimpl<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,
sourceimpl<K, T> Logical<K, T> where
K: PolarsDataType,
T: PolarsDataType,
Logical<K, T>: LogicalType,
impl<K, T> Logical<K, T> where
K: PolarsDataType,
T: PolarsDataType,
Logical<K, T>: LogicalType,
sourceimpl Logical<DateType, Int32Type>
impl Logical<DateType, Int32Type>
pub fn as_date_iter(
&self
) -> impl Iterator<Item = Option<NaiveDate>> + TrustedLen
sourcepub fn from_naive_date<I>(name: &str, v: I) -> Logical<DateType, Int32Type> where
I: IntoIterator<Item = NaiveDate>,
pub fn from_naive_date<I>(name: &str, v: I) -> Logical<DateType, Int32Type> where
I: IntoIterator<Item = NaiveDate>,
Construct a new DateChunked
from an iterator over NaiveDate
.
sourcepub fn from_naive_date_options<I>(
name: &str,
v: I
) -> Logical<DateType, Int32Type> where
I: IntoIterator<Item = Option<NaiveDate>>,
pub fn from_naive_date_options<I>(
name: &str,
v: I
) -> Logical<DateType, Int32Type> where
I: IntoIterator<Item = Option<NaiveDate>>,
Construct a new DateChunked
from an iterator over optional NaiveDate
.
sourceimpl Logical<DatetimeType, Int64Type>
impl Logical<DatetimeType, Int64Type>
pub fn as_datetime_iter(
&self
) -> impl Iterator<Item = Option<NaiveDateTime>> + TrustedLen
pub fn time_unit(&self) -> TimeUnit
pub fn time_zone(&self) -> &Option<String>
sourcepub fn from_naive_datetime<I>(
name: &str,
v: I,
tu: TimeUnit
) -> Logical<DatetimeType, Int64Type> where
I: IntoIterator<Item = NaiveDateTime>,
pub fn from_naive_datetime<I>(
name: &str,
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: &str,
v: I,
tu: TimeUnit
) -> Logical<DatetimeType, Int64Type> where
I: IntoIterator<Item = Option<NaiveDateTime>>,
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, tu: TimeUnit)
pub fn set_time_unit(&mut self, tu: TimeUnit)
Change the underlying TimeUnit
. This does not modify the data.
sourcepub fn set_time_zone(&mut self, tz: Option<String>)
pub fn set_time_zone(&mut self, tz: Option<String>)
Change the underlying TimeZone
. This does not modify the data.
sourceimpl 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 from_duration<I>(
name: &str,
v: I,
tu: TimeUnit
) -> Logical<DurationType, Int64Type> where
I: IntoIterator<Item = Duration>,
pub fn from_duration<I>(
name: &str,
v: I,
tu: TimeUnit
) -> Logical<DurationType, Int64Type> where
I: IntoIterator<Item = Duration>,
Construct a new DurationChunked
from an iterator over ChronoDuration
.
sourcepub fn from_duration_options<I>(
name: &str,
v: I,
tu: TimeUnit
) -> Logical<DurationType, Int64Type> where
I: IntoIterator<Item = Option<Duration>>,
pub fn from_duration_options<I>(
name: &str,
v: I,
tu: TimeUnit
) -> Logical<DurationType, Int64Type> where
I: IntoIterator<Item = Option<Duration>>,
Construct a new DurationChunked
from an iterator over optional ChronoDuration
.
sourceimpl Logical<TimeType, Int64Type>
impl Logical<TimeType, Int64Type>
pub fn as_time_iter(
&self
) -> impl Iterator<Item = Option<NaiveTime>> + TrustedLen
sourcepub fn from_naive_time<I>(name: &str, v: I) -> Logical<TimeType, Int64Type> where
I: IntoIterator<Item = NaiveTime>,
pub fn from_naive_time<I>(name: &str, 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: &str,
v: I
) -> Logical<TimeType, Int64Type> where
I: IntoIterator<Item = Option<NaiveTime>>,
pub fn from_naive_time_options<I>(
name: &str,
v: I
) -> Logical<TimeType, Int64Type> where
I: IntoIterator<Item = Option<NaiveTime>>,
Construct a new TimeChunked
from an iterator over optional NaiveTime
.
Methods from Deref<Target = ChunkedArray<T>>
sourcepub fn abs(&self) -> ChunkedArray<T>
pub fn abs(&self) -> ChunkedArray<T>
Convert all values to their absolute/positive value.
sourcepub fn append(&mut self, other: &ChunkedArray<T>)
pub fn append(&mut self, other: &ChunkedArray<T>)
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 extend(&mut self, other: &ChunkedArray<T>)
pub fn extend(&mut self, other: &ChunkedArray<T>)
Extend the memory backed by this array with the values from other
.
Different from ChunkedArray::append
which adds chunks to this ChunkedArray
extent
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
.
sourcepub fn rolling_mean(
&self,
options: RollingOptions
) -> Result<Series, PolarsError>
pub fn rolling_mean(
&self,
options: RollingOptions
) -> Result<Series, PolarsError>
Apply a rolling mean (moving mean) over the values in this array.
A window of length window_size
will traverse the array. The values that fill this window
will (optionally) be multiplied with the weights given by the weights
vector. The resulting
values will be aggregated to their mean.
sourcepub fn rolling_sum(
&self,
options: RollingOptions
) -> Result<Series, PolarsError>
pub fn rolling_sum(
&self,
options: RollingOptions
) -> Result<Series, PolarsError>
Apply a rolling sum (moving sum) over the values in this array.
A window of length window_size
will traverse the array. The values that fill this window
will (optionally) be multiplied with the weights given by the weights
vector. The resulting
values will be aggregated to their sum.
sourcepub fn rolling_median(
&self,
options: RollingOptions
) -> Result<Series, PolarsError>
pub fn rolling_median(
&self,
options: RollingOptions
) -> Result<Series, PolarsError>
Apply a rolling median (moving median) over the values in this array.
A window of length window_size
will traverse the array. The values that fill this window
will (optionally) be weighted according to the weights
vector.
sourcepub fn rolling_quantile(
&self,
quantile: f64,
interpolation: QuantileInterpolOptions,
options: RollingOptions
) -> Result<Series, PolarsError>
pub fn rolling_quantile(
&self,
quantile: f64,
interpolation: QuantileInterpolOptions,
options: RollingOptions
) -> Result<Series, PolarsError>
Apply a rolling quantile (moving quantile) over the values in this array.
A window of length window_size
will traverse the array. The values that fill this window
will (optionally) be weighted according to the weights
vector.
sourcepub fn rolling_min(
&self,
options: RollingOptions
) -> Result<Series, PolarsError>
pub fn rolling_min(
&self,
options: RollingOptions
) -> Result<Series, PolarsError>
Apply a rolling min (moving min) over the values in this array.
A window of length window_size
will traverse the array. The values that fill this window
will (optionally) be multiplied with the weights given by the weights
vector. The resulting
values will be aggregated to their min.
sourcepub fn rolling_max(
&self,
options: RollingOptions
) -> Result<Series, PolarsError>
pub fn rolling_max(
&self,
options: RollingOptions
) -> Result<Series, PolarsError>
Apply a rolling max (moving max) over the values in this array.
A window of length window_size
will traverse the array. The values that fill this window
will (optionally) be multiplied with the weights given by the weights
vector. The resulting
values will be aggregated to their max.
sourcepub fn rolling_apply_float<F>(
&self,
window_size: usize,
f: F
) -> Result<ChunkedArray<T>, PolarsError> where
F: Fn(&ChunkedArray<T>) -> Option<<T as PolarsNumericType>::Native>,
pub fn rolling_apply_float<F>(
&self,
window_size: usize,
f: F
) -> Result<ChunkedArray<T>, PolarsError> where
F: Fn(&ChunkedArray<T>) -> Option<<T as PolarsNumericType>::Native>,
Apply a rolling custom function. This is pretty slow because of dynamic dispatch.
sourcepub fn rolling_var(
&self,
options: RollingOptions
) -> Result<Series, PolarsError>
pub fn rolling_var(
&self,
options: RollingOptions
) -> Result<Series, PolarsError>
Apply a rolling var (moving var) over the values in this array.
A window of length window_size
will traverse the array. The values that fill this window
will (optionally) be multiplied with the weights given by the weights
vector. The resulting
values will be aggregated to their var.
sourcepub fn rolling_std(
&self,
options: RollingOptions
) -> Result<Series, PolarsError>
pub fn rolling_std(
&self,
options: RollingOptions
) -> Result<Series, PolarsError>
Apply a rolling std (moving std) over the values in this array.
A window of length window_size
will traverse the array. The values that fill this window
will (optionally) be multiplied with the weights given by the weights
vector. The resulting
values will be aggregated to their std.
pub fn arg_true(&self) -> ChunkedArray<UInt32Type>
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.
sourcepub fn to_ndarray(
&self
) -> Result<ArrayBase<ViewRepr<&<T as PolarsNumericType>::Native>, Dim<[usize; 1]>>, PolarsError>
This is supported on crate feature ndarray
only.
pub fn to_ndarray(
&self
) -> Result<ArrayBase<ViewRepr<&<T as PolarsNumericType>::Native>, Dim<[usize; 1]>>, PolarsError>
ndarray
only.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,
This is supported on crate feature ndarray
only.
pub fn to_ndarray<N>(
&self
) -> Result<ArrayBase<OwnedRepr<<N as PolarsNumericType>::Native>, Dim<[usize; 2]>>, PolarsError> where
N: PolarsNumericType,
ndarray
only.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 + 'static, Global>>>>
pub fn amortized_iter(
&self
) -> AmortizedListIter<'_, impl Iterator<Item = Option<Box<dyn Array + 'static, Global>>>>
This is an iterator over a ListChunked that save allocations.
A Series is:
1. Arc
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.
sourcepub fn apply_amortized<'a, F>(&'a self, f: F) -> ChunkedArray<ListType> where
F: FnMut(UnstableSeries<'a>) -> Series,
pub fn apply_amortized<'a, F>(&'a self, f: F) -> ChunkedArray<ListType> where
F: FnMut(UnstableSeries<'a>) -> Series,
Apply a closure F
elementwise.
pub fn try_apply_amortized<'a, F>(
&'a self,
f: F
) -> Result<ChunkedArray<ListType>, PolarsError> where
F: FnMut(UnstableSeries<'a>) -> Result<Series, PolarsError>,
sourcepub fn lst_join(
&self,
separator: &str
) -> Result<ChunkedArray<Utf8Type>, PolarsError>
pub fn lst_join(
&self,
separator: &str
) -> Result<ChunkedArray<Utf8Type>, PolarsError>
In case the inner dtype DataType::Utf8
, the individual items will be joined into a
single string separated by separator
.
pub fn lst_max(&self) -> Series
pub fn lst_min(&self) -> Series
pub fn lst_sum(&self) -> Series
pub fn lst_mean(&self) -> ChunkedArray<Float64Type>
pub fn lst_sort(&self, reverse: bool) -> ChunkedArray<ListType>
pub fn lst_reverse(&self) -> ChunkedArray<ListType>
pub fn lst_unique(&self) -> Result<ChunkedArray<ListType>, PolarsError>
pub fn lst_arg_min(&self) -> ChunkedArray<UInt32Type>
pub fn lst_arg_max(&self) -> ChunkedArray<UInt32Type>
pub fn lst_diff(
&self,
n: usize,
null_behavior: NullBehavior
) -> ChunkedArray<ListType>
diff
only.pub fn lst_shift(&self, periods: i64) -> ChunkedArray<ListType>
pub fn lst_slice(&self, offset: i64, length: usize) -> ChunkedArray<ListType>
pub fn lst_lengths(&self) -> ChunkedArray<UInt32Type>
sourcepub fn lst_get(&self, idx: i64) -> Result<Series, PolarsError>
pub fn lst_get(&self, idx: i64) -> Result<Series, PolarsError>
Get the value by index in the sublists.
So index 0
would return the first item of every sublist
and index -1
would return the last item of every sublist
if an index is out of bounds, it will return a None
.
pub fn lst_concat(
&self,
other: &[Series]
) -> Result<ChunkedArray<ListType>, PolarsError>
pub fn set_fast_explode(&mut self)
pub fn to_logical(&mut self, inner_dtype: DataType)
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,
seed: u64
) -> Result<ChunkedArray<T>, PolarsError>
pub fn sample_n(
&self,
n: usize,
with_replacement: bool,
seed: u64
) -> Result<ChunkedArray<T>, PolarsError>
Sample n datapoints from this ChunkedArray.
sourcepub fn sample_frac(
&self,
frac: f64,
with_replacement: bool,
seed: u64
) -> Result<ChunkedArray<T>, PolarsError>
pub fn sample_frac(
&self,
frac: f64,
with_replacement: bool,
seed: u64
) -> Result<ChunkedArray<T>, PolarsError>
Sample a fraction between 0.0-1.0 of this ChunkedArray.
sourcepub fn json_path_match(
&self,
json_path: &str
) -> Result<ChunkedArray<Utf8Type>, PolarsError>
pub fn json_path_match(
&self,
json_path: &str
) -> Result<ChunkedArray<Utf8Type>, PolarsError>
Extract json path, first match Refer to https://goessner.net/articles/JsonPath/
pub fn hex_decode(
&self,
strict: Option<bool>
) -> Result<ChunkedArray<Utf8Type>, PolarsError>
pub fn hex_encode(&self) -> ChunkedArray<Utf8Type>
pub fn base64_decode(
&self,
strict: Option<bool>
) -> Result<ChunkedArray<Utf8Type>, PolarsError>
pub fn base64_encode(&self) -> ChunkedArray<Utf8Type>
sourcepub fn str_lengths(&self) -> ChunkedArray<UInt32Type>
pub fn str_lengths(&self) -> ChunkedArray<UInt32Type>
Get the length of the string values.
sourcepub fn contains(
&self,
pat: &str
) -> Result<ChunkedArray<BooleanType>, PolarsError>
pub fn contains(
&self,
pat: &str
) -> Result<ChunkedArray<BooleanType>, PolarsError>
Check if strings contain a regex pattern
sourcepub fn replace(
&self,
pat: &str,
val: &str
) -> Result<ChunkedArray<Utf8Type>, PolarsError>
pub fn replace(
&self,
pat: &str,
val: &str
) -> Result<ChunkedArray<Utf8Type>, PolarsError>
Replace the leftmost (sub)string by a regex pattern
sourcepub fn replace_all(
&self,
pat: &str,
val: &str
) -> Result<ChunkedArray<Utf8Type>, PolarsError>
pub fn replace_all(
&self,
pat: &str,
val: &str
) -> Result<ChunkedArray<Utf8Type>, PolarsError>
Replace all (sub)strings by a regex pattern
sourcepub fn extract(
&self,
pat: &str,
group_index: usize
) -> Result<ChunkedArray<Utf8Type>, PolarsError>
pub fn extract(
&self,
pat: &str,
group_index: usize
) -> Result<ChunkedArray<Utf8Type>, PolarsError>
Extract the nth capture group from pattern
sourcepub fn to_lowercase(&self) -> ChunkedArray<Utf8Type>
pub fn to_lowercase(&self) -> ChunkedArray<Utf8Type>
Modify the strings to their lowercase equivalent
sourcepub fn to_uppercase(&self) -> ChunkedArray<Utf8Type>
pub fn to_uppercase(&self) -> ChunkedArray<Utf8Type>
Modify the strings to their uppercase equivalent
sourcepub fn concat(&self, other: &ChunkedArray<Utf8Type>) -> ChunkedArray<Utf8Type>
pub fn concat(&self, other: &ChunkedArray<Utf8Type>) -> ChunkedArray<Utf8Type>
Concat with the values from a second Utf8Chunked
sourcepub fn str_slice(
&self,
start: i64,
length: Option<u64>
) -> Result<ChunkedArray<Utf8Type>, PolarsError>
pub fn str_slice(
&self,
start: i64,
length: Option<u64>
) -> Result<ChunkedArray<Utf8Type>, PolarsError>
Slice the string values
Determines a substring starting from start
and with optional length length
of each of the elements in array
.
start
can be negative, in which case the start counts from the end of the string.
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 iter_validities(&self) -> impl Iterator<Item = Option<&Bitmap>>
pub fn iter_validities(&self) -> impl Iterator<Item = Option<&Bitmap>>
Get the buffer of bits representing null values
sourcepub fn has_validity(&self) -> bool
pub fn has_validity(&self) -> bool
Return if any the chunks in this [ChunkedArray]
have a validity bitmap.
no bitmap means no null values.
sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrink the capacity of this array to fit it’s length.
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
sourcepub fn chunk_id(
&self
) -> Map<Iter<'_, Arc<dyn Array + 'static>>, fn(&Arc<dyn Array + 'static>) -> usize>
pub fn chunk_id(
&self
) -> Map<Iter<'_, Arc<dyn Array + 'static>>, fn(&Arc<dyn Array + 'static>) -> usize>
Unique id representing the number of chunks
sourcepub fn chunks(&self) -> &Vec<Arc<dyn Array + 'static>, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn chunks(&self) -> &Vec<Arc<dyn Array + 'static>, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
A reference to the chunks
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 null_count(&self) -> usize
pub fn null_count(&self) -> usize
Count the null values.
sourcepub fn append_array(
&mut self,
other: Arc<dyn Array + 'static>
) -> Result<(), PolarsError>
pub fn append_array(
&mut self,
other: Arc<dyn Array + 'static>
) -> Result<(), PolarsError>
Append arrow array in place.
let mut array = Int32Chunked::new("array", &[1, 2]);
let array_2 = Int32Chunked::new("2nd", &[3]);
array.append(&array_2);
assert_eq!(Vec::from(&array), [Some(1), Some(2), Some(3)])
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 cont_slice(
&self
) -> Result<&[<T as PolarsNumericType>::Native], PolarsError>
pub fn cont_slice(
&self
) -> Result<&[<T as PolarsNumericType>::Native], PolarsError>
Contiguous slice
sourcepub fn data_views(
&self
) -> impl Iterator<Item = &[<T as PolarsNumericType>::Native]> + DoubleEndedIterator
pub fn data_views(
&self
) -> impl Iterator<Item = &[<T as PolarsNumericType>::Native]> + 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 Iterator<Item = <T as PolarsNumericType>::Native> + Send + Sync + ExactSizeIterator + DoubleEndedIterator + TrustedLen
sourcepub fn inner_dtype(&self) -> DataType
pub fn inner_dtype(&self) -> DataType
Get the inner data type of the list.
sourcepub fn lhs_sub<N>(&self, lhs: N) -> ChunkedArray<T> where
N: Num + NumCast,
pub fn lhs_sub<N>(&self, lhs: N) -> ChunkedArray<T> where
N: Num + NumCast,
Apply lhs - self
sourcepub fn lhs_div<N>(&self, lhs: N) -> ChunkedArray<T> where
N: Num + NumCast,
pub fn lhs_div<N>(&self, lhs: N) -> ChunkedArray<T> where
N: Num + NumCast,
Apply lhs / self
sourcepub fn lhs_rem<N>(&self, lhs: N) -> ChunkedArray<T> where
N: Num + NumCast,
pub fn lhs_rem<N>(&self, lhs: N) -> ChunkedArray<T> where
N: Num + NumCast,
Apply lhs % self
Trait Implementations
sourceimpl<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,
sourceimpl DateMethods for Logical<DateType, Int32Type>
impl DateMethods for Logical<DateType, Int32Type>
sourcefn year(&self) -> ChunkedArray<Int32Type>
fn year(&self) -> ChunkedArray<Int32Type>
Extract month from underlying NaiveDate representation. Returns the year number in the calendar date.
sourcefn month(&self) -> ChunkedArray<UInt32Type>
fn month(&self) -> ChunkedArray<UInt32Type>
Extract month from underlying NaiveDateTime representation. Returns the month number starting from 1.
The return value ranges from 1 to 12.
sourcefn weekday(&self) -> ChunkedArray<UInt32Type>
fn weekday(&self) -> ChunkedArray<UInt32Type>
Extract weekday from underlying NaiveDate representation. Returns the weekday number where monday = 0 and sunday = 6
sourcefn week(&self) -> ChunkedArray<UInt32Type>
fn week(&self) -> ChunkedArray<UInt32Type>
Returns the ISO week number starting from 1. The return value ranges from 1 to 53. (The last week of year differs by years.)
sourcefn day(&self) -> ChunkedArray<UInt32Type>
fn day(&self) -> ChunkedArray<UInt32Type>
Extract day from underlying NaiveDate representation. Returns the day of month starting from 1.
The return value ranges from 1 to 31. (The last day of month differs by months.)
sourcefn ordinal(&self) -> ChunkedArray<UInt32Type>
fn ordinal(&self) -> ChunkedArray<UInt32Type>
Returns the day of year starting from 1.
The return value ranges from 1 to 366. (The last day of year differs by years.)
sourcefn strftime(&self, fmt: &str) -> ChunkedArray<Utf8Type>
fn strftime(&self, fmt: &str) -> ChunkedArray<Utf8Type>
Format Date with a fmt
rule. See chrono strftime/strptime.
fn parse_from_str_slice(
name: &str,
v: &[&str],
fmt: &str
) -> Logical<DateType, Int32Type>
sourceimpl DatetimeMethods for Logical<DatetimeType, Int64Type>
impl DatetimeMethods for Logical<DatetimeType, Int64Type>
sourcefn year(&self) -> ChunkedArray<Int32Type>
fn year(&self) -> ChunkedArray<Int32Type>
Extract month from underlying NaiveDateTime representation. Returns the year number in the calendar date.
sourcefn month(&self) -> ChunkedArray<UInt32Type>
fn month(&self) -> ChunkedArray<UInt32Type>
Extract month from underlying NaiveDateTime representation. Returns the month number starting from 1.
The return value ranges from 1 to 12.
sourcefn weekday(&self) -> ChunkedArray<UInt32Type>
fn weekday(&self) -> ChunkedArray<UInt32Type>
Extract weekday from underlying NaiveDateTime representation. Returns the weekday number where monday = 0 and sunday = 6
sourcefn week(&self) -> ChunkedArray<UInt32Type>
fn week(&self) -> ChunkedArray<UInt32Type>
Returns the ISO week number starting from 1. The return value ranges from 1 to 53. (The last week of year differs by years.)
sourcefn day(&self) -> ChunkedArray<UInt32Type>
fn day(&self) -> ChunkedArray<UInt32Type>
Extract day from underlying NaiveDateTime representation. Returns the day of month starting from 1.
The return value ranges from 1 to 31. (The last day of month differs by months.)
sourcefn hour(&self) -> ChunkedArray<UInt32Type>
fn hour(&self) -> ChunkedArray<UInt32Type>
Extract hour from underlying NaiveDateTime representation. Returns the hour number from 0 to 23.
sourcefn minute(&self) -> ChunkedArray<UInt32Type>
fn minute(&self) -> ChunkedArray<UInt32Type>
Extract minute from underlying NaiveDateTime representation. Returns the minute number from 0 to 59.
sourcefn second(&self) -> ChunkedArray<UInt32Type>
fn second(&self) -> ChunkedArray<UInt32Type>
Extract second from underlying NaiveDateTime representation. Returns the second number from 0 to 59.
sourcefn nanosecond(&self) -> ChunkedArray<UInt32Type>
fn nanosecond(&self) -> ChunkedArray<UInt32Type>
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.
sourcefn ordinal(&self) -> ChunkedArray<UInt32Type>
fn ordinal(&self) -> ChunkedArray<UInt32Type>
Returns the day of year starting from 1.
The return value ranges from 1 to 366. (The last day of year differs by years.)
sourcefn strftime(&self, fmt: &str) -> ChunkedArray<Utf8Type>
fn strftime(&self, fmt: &str) -> ChunkedArray<Utf8Type>
Format Datetime with a fmt
rule. See chrono strftime/strptime.
fn parse_from_str_slice(
name: &str,
v: &[&str],
fmt: &str,
tu: TimeUnit
) -> Logical<DatetimeType, Int64Type>
sourceimpl<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,
sourceimpl<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,
sourceimpl DurationMethods for Logical<DurationType, Int64Type>
impl DurationMethods for Logical<DurationType, Int64Type>
sourcefn hours(&self) -> ChunkedArray<Int64Type>
fn hours(&self) -> ChunkedArray<Int64Type>
Extract the hours from a Duration
sourcefn days(&self) -> ChunkedArray<Int64Type>
fn days(&self) -> ChunkedArray<Int64Type>
Extract the days from a Duration
sourcefn milliseconds(&self) -> ChunkedArray<Int64Type>
fn milliseconds(&self) -> ChunkedArray<Int64Type>
Extract the milliseconds from a Duration
sourcefn nanoseconds(&self) -> ChunkedArray<Int64Type>
fn nanoseconds(&self) -> ChunkedArray<Int64Type>
Extract the nanoseconds from a Duration
sourcefn seconds(&self) -> ChunkedArray<Int64Type>
fn seconds(&self) -> ChunkedArray<Int64Type>
Extract the seconds from a Duration
sourceimpl IntoSeries for Logical<TimeType, Int64Type>
impl IntoSeries for Logical<TimeType, Int64Type>
sourceimpl IntoSeries for Logical<DateType, Int32Type>
impl IntoSeries for Logical<DateType, Int32Type>
sourceimpl IntoSeries for Logical<DatetimeType, Int64Type>
impl IntoSeries for Logical<DatetimeType, Int64Type>
sourceimpl IntoSeries for Logical<DurationType, Int64Type>
impl IntoSeries for Logical<DurationType, Int64Type>
sourceimpl LogicalType for Logical<TimeType, Int64Type>
impl LogicalType for Logical<TimeType, Int64Type>
sourceimpl LogicalType for Logical<DurationType, Int64Type>
impl LogicalType for Logical<DurationType, Int64Type>
sourceimpl LogicalType for Logical<DateType, Int32Type>
impl LogicalType for Logical<DateType, Int32Type>
sourceimpl LogicalType for Logical<DatetimeType, Int64Type>
impl LogicalType for Logical<DatetimeType, Int64Type>
sourceimpl<T> NamedFrom<T, [Duration]> for Logical<DurationType, Int64Type> where
T: AsRef<[Duration]>,
impl<T> NamedFrom<T, [Duration]> for Logical<DurationType, Int64Type> where
T: AsRef<[Duration]>,
sourceimpl<T> NamedFrom<T, [NaiveDate]> for Logical<DateType, Int32Type> where
T: AsRef<[NaiveDate]>,
impl<T> NamedFrom<T, [NaiveDate]> for Logical<DateType, Int32Type> where
T: AsRef<[NaiveDate]>,
sourceimpl<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]>,
sourceimpl<T> NamedFrom<T, [NaiveTime]> for Logical<TimeType, Int64Type> where
T: AsRef<[NaiveTime]>,
impl<T> NamedFrom<T, [NaiveTime]> for Logical<TimeType, Int64Type> where
T: AsRef<[NaiveTime]>,
sourceimpl<T> NamedFrom<T, [Option<Duration>]> for Logical<DurationType, Int64Type> where
T: AsRef<[Option<Duration>]>,
impl<T> NamedFrom<T, [Option<Duration>]> for Logical<DurationType, Int64Type> where
T: AsRef<[Option<Duration>]>,
sourceimpl<T> NamedFrom<T, [Option<NaiveDate>]> for Logical<DateType, Int32Type> where
T: AsRef<[Option<NaiveDate>]>,
impl<T> NamedFrom<T, [Option<NaiveDate>]> for Logical<DateType, Int32Type> where
T: AsRef<[Option<NaiveDate>]>,
sourceimpl<T> NamedFrom<T, [Option<NaiveDateTime>]> for Logical<DatetimeType, Int64Type> where
T: AsRef<[Option<NaiveDateTime>]>,
impl<T> NamedFrom<T, [Option<NaiveDateTime>]> for Logical<DatetimeType, Int64Type> where
T: AsRef<[Option<NaiveDateTime>]>,
sourceimpl<T> NamedFrom<T, [Option<NaiveTime>]> for Logical<TimeType, Int64Type> where
T: AsRef<[Option<NaiveTime>]>,
impl<T> NamedFrom<T, [Option<NaiveTime>]> for Logical<TimeType, Int64Type> where
T: AsRef<[Option<NaiveTime>]>,
sourceimpl PolarsTruncate for Logical<DateType, Int32Type>
impl PolarsTruncate for Logical<DateType, Int32Type>
sourceimpl PolarsTruncate for Logical<DatetimeType, Int64Type>
impl PolarsTruncate for Logical<DatetimeType, Int64Type>
sourceimpl TimeMethods for Logical<TimeType, Int64Type>
impl TimeMethods for Logical<TimeType, Int64Type>
sourcefn strftime(&self, fmt: &str) -> ChunkedArray<Utf8Type>
fn strftime(&self, fmt: &str) -> ChunkedArray<Utf8Type>
Format Date with a fmt
rule. See chrono strftime/strptime.
sourcefn hour(&self) -> ChunkedArray<UInt32Type>
fn hour(&self) -> ChunkedArray<UInt32Type>
Extract hour from underlying NaiveDateTime representation. Returns the hour number from 0 to 23.
sourcefn minute(&self) -> ChunkedArray<UInt32Type>
fn minute(&self) -> ChunkedArray<UInt32Type>
Extract minute from underlying NaiveDateTime representation. Returns the minute number from 0 to 59.
sourcefn second(&self) -> ChunkedArray<UInt32Type>
fn second(&self) -> ChunkedArray<UInt32Type>
Extract second from underlying NaiveDateTime representation. Returns the second number from 0 to 59.
sourcefn nanosecond(&self) -> ChunkedArray<UInt32Type>
fn nanosecond(&self) -> ChunkedArray<UInt32Type>
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: &str,
v: &[&str],
fmt: &str
) -> Logical<TimeType, Int64Type>
Auto Trait Implementations
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,
Physical: Unpin,
impl<Logical, Physical> !UnwindSafe for Logical<Logical, Physical>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more