pub struct IndexSpace {
pub time_unit: TimeUnit,
/* private fields */
}temporal only.Expand description
The i64 space a temporal group-by computes its windows in: the unit and zone of the
Datetime the index is cast to.
Fields§
§time_unit: TimeUnitImplementations§
Source§impl IndexSpace
impl IndexSpace
Sourcepub fn dynamic(index_dtype: &DataType) -> Result<IndexSpace, PolarsError>
pub fn dynamic(index_dtype: &DataType) -> Result<IndexSpace, PolarsError>
The space for a group_by_dynamic index of index_dtype, which must be a Datetime,
Date or signed integer.
A zone chrono-tz cannot parse, which needs POLARS_IGNORE_TIMEZONE_PARSE_ERROR=1 or
the timezones feature to be off, is kept in time_zone but ignored for the
arithmetic: the engines compute such windows as if the index had no zone, and so does
this.
Sourcepub fn rolling(index_dtype: &DataType) -> Result<IndexSpace, PolarsError>
pub fn rolling(index_dtype: &DataType) -> Result<IndexSpace, PolarsError>
The space for a rolling index of index_dtype, which may also be an unsigned integer.
See Self::dynamic for the zone handling.
Sourcepub fn tz(&self) -> Option<&Tz>
pub fn tz(&self) -> Option<&Tz>
The zone the arithmetic runs in, as Duration and Window take it. None when the
index has no zone or one the engines ignore, see Self::dynamic.
Sourcepub fn window_dtype(&self) -> DataType
pub fn window_dtype(&self) -> DataType
The Datetime dtype of this space.
Sourcepub fn cast_to_space(&self, index: &Column) -> Result<Column, PolarsError>
pub fn cast_to_space(&self, index: &Column) -> Result<Column, PolarsError>
index, a column of the dtype this space was made for, cast to Self::window_dtype.
Sourcepub fn cast_from_space(&self, column: &Column) -> Result<Column, PolarsError>
pub fn cast_from_space(&self, column: &Column) -> Result<Column, PolarsError>
column, in Self::window_dtype, cast back to the dtype this space was made for.
Sourcepub fn cast_to_boundary(&self, column: &Column) -> Result<Column, PolarsError>
pub fn cast_to_boundary(&self, column: &Column) -> Result<Column, PolarsError>
column, in Self::window_dtype, cast to the dtype of a group_by_dynamic window
boundary: the index dtype, except that boundaries of a Date index stay a Datetime
because a window need not start on a day.
Trait Implementations§
Source§impl Clone for IndexSpace
impl Clone for IndexSpace
Source§fn clone(&self) -> IndexSpace
fn clone(&self) -> IndexSpace
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for IndexSpace
impl !UnwindSafe for IndexSpace
impl Freeze for IndexSpace
impl Send for IndexSpace
impl Sync for IndexSpace
impl Unpin for IndexSpace
impl UnsafeUnpin for IndexSpace
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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