pub type DurationChunked = Logical<DurationType, Int64Type>;
Aliased Type§
struct DurationChunked(pub ChunkedArray<Int64Type>, _, pub Option<DataType>);
Fields§
§0: ChunkedArray<Int64Type>
§2: Option<DataType>
Implementations
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<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,
Trait Implementations
Source§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<K, T> Default for Logical<K, T>where
K: PolarsDataType,
T: PolarsDataType,
impl<K, T> Default for Logical<K, T>where
K: PolarsDataType,
T: PolarsDataType,
Source§impl<K, T> Deref for Logical<K, T>where
K: PolarsDataType,
T: PolarsDataType,
impl<K, T> Deref for Logical<K, T>where
K: PolarsDataType,
T: PolarsDataType,
Source§impl<K, T> DerefMut for Logical<K, T>where
K: PolarsDataType,
T: PolarsDataType,
impl<K, T> DerefMut for Logical<K, T>where
K: PolarsDataType,
T: PolarsDataType,
Source§impl DurationMethods for Logical<DurationType, Int64Type>
impl DurationMethods for Logical<DurationType, Int64Type>
Source§fn hours(&self) -> ChunkedArray<Int64Type>
fn hours(&self) -> ChunkedArray<Int64Type>
Extract the hours from a Duration
Source§fn days(&self) -> ChunkedArray<Int64Type>
fn days(&self) -> ChunkedArray<Int64Type>
Extract the days from a Duration
Source§fn minutes(&self) -> ChunkedArray<Int64Type>
fn minutes(&self) -> ChunkedArray<Int64Type>
Extract the seconds from a Duration
Source§fn seconds(&self) -> ChunkedArray<Int64Type>
fn seconds(&self) -> ChunkedArray<Int64Type>
Extract the seconds from a Duration
Source§fn milliseconds(&self) -> ChunkedArray<Int64Type>
fn milliseconds(&self) -> ChunkedArray<Int64Type>
Extract the milliseconds from a Duration
Source§fn microseconds(&self) -> ChunkedArray<Int64Type>
fn microseconds(&self) -> ChunkedArray<Int64Type>
Extract the microseconds from a Duration
Source§fn nanoseconds(&self) -> ChunkedArray<Int64Type>
fn nanoseconds(&self) -> ChunkedArray<Int64Type>
Extract the nanoseconds from a Duration
Source§impl IntoSeries for Logical<DurationType, Int64Type>
impl IntoSeries for Logical<DurationType, Int64Type>
Source§impl LogicalType for Logical<DurationType, Int64Type>
impl LogicalType for Logical<DurationType, Int64Type>
Source§fn dtype(&self) -> &DataType
fn dtype(&self) -> &DataType
Get data type of
ChunkedArray
.Source§fn get_any_value(&self, i: usize) -> Result<AnyValue<'_>, PolarsError>
fn get_any_value(&self, i: usize) -> Result<AnyValue<'_>, PolarsError>
Gets
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<T> NamedFrom<T, [Option<TimeDelta>]> for Logical<DurationType, Int64Type>
impl<T> NamedFrom<T, [Option<TimeDelta>]> for Logical<DurationType, Int64Type>
Source§fn new(name: PlSmallStr, v: T) -> Logical<DurationType, Int64Type>
fn new(name: PlSmallStr, v: T) -> Logical<DurationType, Int64Type>
Initialize by name and values.