Trait polars::chunked_array::object::ChunkWindow [−][src]
pub trait ChunkWindow { fn rolling_sum(
&self,
_window_size: u32,
_weight: Option<&[f64]>,
_ignore_null: bool,
_min_periods: u32
) -> Result<Self, PolarsError> { ... } fn rolling_mean(
&self,
_window_size: u32,
_weight: Option<&[f64]>,
_ignore_null: bool,
_min_periods: u32
) -> Result<Self, PolarsError> { ... } fn rolling_min(
&self,
_window_size: u32,
_weight: Option<&[f64]>,
_ignore_null: bool,
_min_periods: u32
) -> Result<Self, PolarsError> { ... } fn rolling_max(
&self,
_window_size: u32,
_weight: Option<&[f64]>,
_ignore_null: bool,
_min_periods: u32
) -> Result<Self, PolarsError> { ... } }
Expand description
Rolling window functions
Provided methods
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 weight
vector. the resulting
values will be aggregated to their sum.
Arguments
window_size
- The length of the window.weight
- An optional slice with the same length of the window that will be multiplied elementwise with the values in the window.ignore_null
- Toggle behavior of aggregation regarding null values in the window.true
-> Null values will be ignored.false
-> Any Null in the window leads to a Null in the aggregation result.
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 weight
vector. The resulting
values will be aggregated to their mean.
Arguments
window_size
- The length of the window.weight
- An optional slice with the same length of the window that will be multiplied elementwise with the values in the window.ignore_null
- Toggle behavior of aggregation regarding null values in the window.true
-> Null values will be ignored.false
-> Any Null in the window leads to a Null in the aggregation result.min_periods
- Amount of elements in the window that should be filled before computing a result.
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 weight
vector. The resulting
values will be aggregated to their min.
Arguments
window_size
- The length of the window.weight
- An optional slice with the same length of the window that will be multiplied elementwise with the values in the window.ignore_null
- Toggle behavior of aggregation regarding null values in the window.true
-> Null values will be ignored.false
-> Any Null in the window leads to a Null in the aggregation result.min_periods
- Amount of elements in the window that should be filled before computing a result.
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 weight
vector. The resulting
values will be aggregated to their max.
Arguments
window_size
- The length of the window.weight
- An optional slice with the same length of the window that will be multiplied elementwise with the values in the window.ignore_null
- Toggle behavior of aggregation regarding null values in the window.true
-> Null values will be ignored.false
-> Any Null in the window leads to a Null in the aggregation result.min_periods
- Amount of elements in the window that should be filled before computing a result.
Implementors
impl<T> ChunkWindow for ChunkedArray<T> where
T: PolarsNumericType,
<T as ArrowPrimitiveType>::Native: Mul<<T as ArrowPrimitiveType>::Native>,
<T as ArrowPrimitiveType>::Native: Add<<T as ArrowPrimitiveType>::Native>,
<T as ArrowPrimitiveType>::Native: Div<<T as ArrowPrimitiveType>::Native>,
<T as ArrowPrimitiveType>::Native: Rem<<T as ArrowPrimitiveType>::Native>,
<T as ArrowPrimitiveType>::Native: Sub<<T as ArrowPrimitiveType>::Native>,
<T as ArrowPrimitiveType>::Native: Zero,
<T as ArrowPrimitiveType>::Native: Bounded,
<T as ArrowPrimitiveType>::Native: NumCast,
<T as ArrowPrimitiveType>::Native: PartialOrd<<T as ArrowPrimitiveType>::Native>,
<T as ArrowPrimitiveType>::Native: One,
<T as ArrowPrimitiveType>::Native: Copy,
<<T as ArrowPrimitiveType>::Native as Add<<T as ArrowPrimitiveType>::Native>>::Output == <T as ArrowPrimitiveType>::Native,
<<T as ArrowPrimitiveType>::Native as Sub<<T as ArrowPrimitiveType>::Native>>::Output == <T as ArrowPrimitiveType>::Native,
<<T as ArrowPrimitiveType>::Native as Mul<<T as ArrowPrimitiveType>::Native>>::Output == <T as ArrowPrimitiveType>::Native,
<<T as ArrowPrimitiveType>::Native as Div<<T as ArrowPrimitiveType>::Native>>::Output == <T as ArrowPrimitiveType>::Native,
<<T as ArrowPrimitiveType>::Native as Rem<<T as ArrowPrimitiveType>::Native>>::Output == <T as ArrowPrimitiveType>::Native,