Type Alias DatetimeChunked

Source
pub type DatetimeChunked = Logical<DatetimeType, Int64Type>;

Aliased Type§

struct DatetimeChunked(pub ChunkedArray<Int64Type>, _, pub Option<DataType>);

Fields§

§0: ChunkedArray<Int64Type>§2: Option<DataType>

Implementations

Source§

impl Logical<DatetimeType, Int64Type>

Source

pub fn as_datetime_iter(&self) -> impl TrustedLen

Source

pub fn time_unit(&self) -> TimeUnit

Source

pub fn time_zone(&self) -> &Option<PlSmallStr>

Source

pub fn to_string( &self, format: &str, ) -> Result<ChunkedArray<StringType>, PolarsError>

Convert from Datetime into String with the given format. See chrono strftime/strptime.

Source

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.

Source

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.

Source

pub fn from_naive_datetime_options<I>( name: PlSmallStr, v: I, tu: TimeUnit, ) -> Logical<DatetimeType, Int64Type>
where I: IntoIterator<Item = Option<NaiveDateTime>>,

Source

pub fn cast_time_unit(&self, tu: TimeUnit) -> Logical<DatetimeType, Int64Type>

Change the underlying TimeUnit. And update the data accordingly.

Source

pub fn set_time_unit(&mut self, time_unit: TimeUnit)

Change the underlying TimeUnit. This does not modify the data.

Source

pub fn set_time_zone( &mut self, time_zone: PlSmallStr, ) -> Result<(), PolarsError>

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.

Source

pub fn set_time_unit_and_time_zone( &mut self, time_unit: TimeUnit, time_zone: PlSmallStr, ) -> Result<(), PolarsError>

Change the underlying TimeUnit and 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.

Source§

impl<K, T> Logical<K, T>

Source

pub fn new_logical<J>(ca: ChunkedArray<T>) -> Logical<J, T>
where J: PolarsDataType,

Source§

impl<K, T> Logical<K, T>

Source

pub fn physical(&self) -> &ChunkedArray<T>

Source

pub fn field(&self) -> Field

Trait Implementations

Source§

impl<K, T> Clone for Logical<K, T>

Source§

fn clone(&self) -> Logical<K, T>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl DatetimeMethods for Logical<DatetimeType, Int64Type>

Source§

fn year(&self) -> ChunkedArray<Int32Type>

Extract month from underlying NaiveDateTime representation. Returns the year number in the calendar date.
Source§

fn is_leap_year(&self) -> ChunkedArray<BooleanType>

Extract year from underlying NaiveDate representation. Returns whether the year is a leap year.
Source§

fn iso_year(&self) -> ChunkedArray<Int32Type>

Source§

fn quarter(&self) -> ChunkedArray<Int8Type>

Extract quarter from underlying NaiveDateTime representation. Quarters range from 1 to 4.
Source§

fn month(&self) -> ChunkedArray<Int8Type>

Extract month from underlying NaiveDateTime representation. Returns the month number starting from 1. Read more
Source§

fn weekday(&self) -> ChunkedArray<Int8Type>

Extract ISO weekday from underlying NaiveDateTime representation. Returns the weekday number where monday = 1 and sunday = 7
Source§

fn week(&self) -> ChunkedArray<Int8Type>

Returns the ISO week number starting from 1. The return value ranges from 1 to 53. (The last week of year differs by years.)
Source§

fn day(&self) -> ChunkedArray<Int8Type>

Extract day from underlying NaiveDateTime representation. Returns the day of month starting from 1. Read more
Source§

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>

Extract minute from underlying NaiveDateTime representation. Returns the minute number from 0 to 59.
Source§

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>

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.
Source§

fn ordinal(&self) -> ChunkedArray<Int16Type>

Returns the day of year starting from 1. Read more
Source§

fn parse_from_str_slice( name: PlSmallStr, v: &[&str], fmt: &str, tu: TimeUnit, ) -> Logical<DatetimeType, Int64Type>

Source§

fn new_from_parts( year: &ChunkedArray<Int32Type>, month: &ChunkedArray<Int8Type>, day: &ChunkedArray<Int8Type>, hour: &ChunkedArray<Int8Type>, minute: &ChunkedArray<Int8Type>, second: &ChunkedArray<Int8Type>, nanosecond: &ChunkedArray<Int32Type>, ambiguous: &ChunkedArray<StringType>, time_unit: &TimeUnit, time_zone: Option<&str>, name: PlSmallStr, ) -> Result<Logical<DatetimeType, Int64Type>, PolarsError>

Construct a datetime ChunkedArray from individual time components.
Source§

impl<K, T> Default for Logical<K, T>

Source§

fn default() -> Logical<K, T>

Returns the “default value” for a type. Read more
Source§

impl<K, T> Deref for Logical<K, T>

Source§

type Target = ChunkedArray<T>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<Logical<K, T> as Deref>::Target

Dereferences the value.
Source§

impl<K, T> DerefMut for Logical<K, T>

Source§

fn deref_mut(&mut self) -> &mut <Logical<K, T> as Deref>::Target

Mutably dereferences the value.
Source§

impl IntoSeries for Logical<DatetimeType, Int64Type>

Source§

impl LogicalType for Logical<DatetimeType, Int64Type>

Source§

fn dtype(&self) -> &DataType

Get data type of ChunkedArray.
Source§

fn get_any_value(&self, i: usize) -> Result<AnyValue<'_>, PolarsError>

Source§

unsafe fn get_any_value_unchecked(&self, i: usize) -> AnyValue<'_>

Safety Read more
Source§

fn cast_with_options( &self, dtype: &DataType, cast_options: CastOptions, ) -> Result<Series, PolarsError>

Source§

fn cast(&self, dtype: &DataType) -> Result<Series, PolarsError>

Source§

impl<T> NamedFrom<T, [NaiveDateTime]> for Logical<DatetimeType, Int64Type>
where T: AsRef<[NaiveDateTime]>,

Source§

fn new(name: PlSmallStr, v: T) -> Logical<DatetimeType, Int64Type>

Initialize by name and values.
Source§

impl<T> NamedFrom<T, [Option<NaiveDateTime>]> for Logical<DatetimeType, Int64Type>
where T: AsRef<[Option<NaiveDateTime>]>,

Source§

fn new(name: PlSmallStr, v: T) -> Logical<DatetimeType, Int64Type>

Initialize by name and values.
Source§

impl PolarsRound for Logical<DatetimeType, Int64Type>

Source§

impl PolarsTruncate for Logical<DatetimeType, Int64Type>