Series.Dt (SeriesDtNameSpace)
Namespace: Polars.FSharp
Instance Methods
AddBusinessDays
Add business days (using integer).
member AddBusinessDays(
n: int,
?weekMask: bool[],
?holidays: seq<DateOnly>,
?roll: Roll
) : SeriesParameters
| Name | Type | Description |
|---|---|---|
n | int | The number of business days to add. |
weekMask | bool[] (optional) | The week mask. |
holidays | seq<DateOnly> (optional) | The holidays. |
roll | Roll (optional) | How to handle rolled dates. |
Returns: Expression/Series of data type Date or Datetime.
BaseUtcOffset
Base offset from UTC. This is usually constant for all datetimes in a given time zone, but may vary in the rare case that a country switches time zone, like Samoa (Apia) did at the end of 2011.
member BaseUtcOffset : unit -> SeriesReturns: Expression/Series of data type Duration.
Century
Extract the century from underlying representation. Returns the century number in the calendar date.
member Century : unit -> SeriesReturns: Expression/Series of data type Int32.
Combine
Combine a date and time into a datetime.
member Combine(time: Expr, ?timeUnit: TimeUnit) : SeriesParameters
| Name | Type | Description |
|---|---|---|
time | Expr | The time to combine with. |
timeUnit | TimeUnit (optional) | The time unit of the time. |
Returns: Expression/Series of data type Datetime.
ConvertTimeZone
Convert to a different time zone.
member ConvertTimeZone(timeZone: string) : SeriesParameters
| Name | Type | Description |
|---|---|---|
timeZone | string | The time zone to convert to. |
Returns: Expression/Series of data type Datetime.
Date
Cast to Date (remove time component).
member Date : unit -> SeriesReturns: Expression/Series of data type Date.
Day
Get the day from the underlying date/datetime.
member Day : unit -> SeriesReturns: Expression/Series of data type Int32.
DayInMonth
Get the number of days in the month from the underlying Date representation.
member DayInMonth : unit -> SeriesReturns: Expression/Series of data type Int8.
DstOffset
Additional offset currently in effect (typically due to daylight saving time).
member DstOffset : unit -> SeriesReturns: Expression/Series of data type Duration.
Epoch
Convert to timestamp.
member Epoch(?timeUnit: EpochTimeUnit) : SeriesParameters
| Name | Type | Description |
|---|---|---|
timeUnit | EpochTimeUnit (optional) | The time unit to convert to. |
Returns: Expression/Series of data type Int64.
Hour
Get the hour from the underlying datetime.
member Hour : unit -> SeriesReturns: Expression/Series of data type Int32.
IsBusinessDay
Check whether the date is a business day.
member IsBusinessDay(?weekMask: bool[], ?holidays: seq<DateOnly>) : SeriesParameters
| Name | Type | Description |
|---|---|---|
weekMask | bool[] (optional) | The week mask. |
holidays | seq<DateOnly> (optional) | The holidays. |
Returns: Expression/Series of data type Boolean.
IsLeapYear
Determine whether the year of the underlying date is a leap year.
member IsLeapYear : unit -> SeriesReturns: Expression/Series of data type Boolean.
IsoYear
Get the ISO year from the underlying date/datetime.
member IsoYear : unit -> SeriesReturns: Expression/Series of data type Int32.
Microsecond
Get the microsecond from the underlying datetime.
member Microsecond : unit -> SeriesReturns: Expression/Series of data type Int32.
Millennium
Extract the millennium from underlying representation. Applies to Date and Datetime columns. Returns the millennium number in the calendar date.
member Millennium : unit -> SeriesReturns: Expression/Series of data type Int32.
Millisecond
Get the millisecond from the underlying datetime.
member Millisecond : unit -> SeriesReturns: Expression/Series of data type Int32.
Minute
Get the minute from the underlying datetime.
member Minute : unit -> SeriesReturns: Expression/Series of data type Int32.
Month
Get the month from the underlying date/datetime.
member Month : unit -> SeriesReturns: Expression/Series of data type Int32.
MonthEnd
Roll forward to the last day of the month. For datetimes, the time-of-day is preserved.
member MonthEnd : unit -> SeriesReturns: Expression/Series of data type Date or Datetime.
MonthStart
Roll backward to the first day of the month. For datetimes, the time-of-day is preserved.
member MonthStart : unit -> SeriesReturns: Expression/Series of data type Date or Datetime.
Nanosecond
Get the nanosecond from the underlying datetime.
member Nanosecond : unit -> SeriesReturns: Expression/Series of data type Int32.
OffsetBy
Offset a datetime by a given duration.
member OffsetBy(duration: Dur) : SeriesParameters
| Name | Type | Description |
|---|---|---|
duration | Dur | The duration to offset by. |
Returns: Expression/Series of data type Date or Datetime.
OrdinalDay
Get the ordinal day (day of year) from the underlying date/datetime.
member OrdinalDay : unit -> SeriesReturns: Expression/Series of data type Int32.
Quarter
Get the quarter from the underlying date/datetime.
member Quarter : unit -> SeriesReturns: Expression/Series of data type Int32.
Replace
Replace the date or time components of a datetime.
member Replace(
?year: int,
?month: int,
?day: int,
?hour: int,
?minute: int,
?second: int,
?microsecond: int,
?ambiguous: Expr
) : SeriesParameters
| Name | Type | Description |
|---|---|---|
year | int (optional) | The new year. |
month | int (optional) | The new month. |
day | int (optional) | The new day. |
hour | int (optional) | The new hour. |
minute | int (optional) | The new minute. |
second | int (optional) | The new second. |
microsecond | int (optional) | The new microsecond. |
ambiguous | Expr (optional) | How to handle ambiguous times. |
Returns: Expression/Series of data type Datetime.
ReplaceTimeZone
Replace the time zone of a datetime.
member ReplaceTimeZone(timeZone: string option, ?ambiguous: Expr, ?nonExistent: NonExistent) : Series
member ReplaceTimeZone(timeZone: string, ?ambiguous: Expr, ?nonExistent: NonExistent) : SeriesParameters
| Name | Type | Description |
|---|---|---|
timeZone | string option | The new time zone. |
ambiguous | Expr (optional) | How to handle ambiguous times. |
nonExistent | NonExistent (optional) | How to handle non-existent times. |
Returns: Expression/Series of data type Datetime.
Round
Round a datetime to the nearest multiple of a given duration.
member Round(every: Dur) : SeriesParameters
| Name | Type | Description |
|---|---|---|
every | Dur | The duration to round to. |
Returns: Expression/Series of data type Date or Datetime.
Second
Get the second from the underlying datetime.
member Second(?fractional: bool) : SeriesParameters
| Name | Type | Description |
|---|---|---|
fractional | bool (optional) | - |
Returns: Expression/Series of data type Int32.
Strftime
Format datetime to string using the given format string (strftime).
member Strftime(?format: string) : SeriesParameters
| Name | Type | Description |
|---|---|---|
format | string (optional) | The format string to use. |
Returns: Expression/Series of data type String.
Time
Cast to Time (remove Date component).
member Time : unit -> SeriesReturns: Expression/Series of data type Time.
Timestamp
Convert to timestamp.
member Timestamp(?timeUnit: TimeUnit) : SeriesParameters
| Name | Type | Description |
|---|---|---|
timeUnit | TimeUnit (optional) | The time unit to convert to. |
Returns: Expression/Series of data type Int64.
TotalDays
Extract the total days from a Duration type.
member TotalDays(?fractional: bool) : SeriesParameters
| Name | Type | Description |
|---|---|---|
fractional | bool (optional) | Whether to include the fractional component of the day. |
Returns: Expression/Series of data type Int64 or Float64 if fractional is set.
TotalHours
Extract the total hours from a Duration type.
member TotalHours(?fractional: bool) : SeriesParameters
| Name | Type | Description |
|---|---|---|
fractional | bool (optional) | Whether to include the fractional component of the hour. |
Returns: Expression/Series of data type Int64 or Float64 if fractional is set.
TotalMicroseconds
Extract the total microseconds from a Duration type.
member TotalMicroseconds(?fractional: bool) : SeriesParameters
| Name | Type | Description |
|---|---|---|
fractional | bool (optional) | Whether to include the fractional component of the microsecond. |
Returns: Expression/Series of data type Int64 or Float64 if fractional is set.
TotalMilliseconds
Extract the total milliseconds from a Duration type.
member TotalMilliseconds(?fractional: bool) : SeriesParameters
| Name | Type | Description |
|---|---|---|
fractional | bool (optional) | Whether to include the fractional component of the millisecond. |
Returns: Expression/Series of data type Int64 or Float64 if fractional is set.
TotalMinutes
Extract the total minutes from a Duration type.
member TotalMinutes(?fractional: bool) : SeriesParameters
| Name | Type | Description |
|---|---|---|
fractional | bool (optional) | Whether to include the fractional component of the minute. |
Returns: Expression/Series of data type Int64 or Float64 if fractional is set.
TotalNanoseconds
Extract the total nanoseconds from a Duration type.
member TotalNanoseconds(?fractional: bool) : SeriesParameters
| Name | Type | Description |
|---|---|---|
fractional | bool (optional) | Whether to include the fractional component of the nanosecond. |
Returns: Expression/Series of data type Int64 or Float64 if fractional is set.
TotalSeconds
Extract the total seconds from a Duration type.
member TotalSeconds(?fractional: bool) : SeriesParameters
| Name | Type | Description |
|---|---|---|
fractional | bool (optional) | Whether to include the fractional component of the second. |
Returns: Expression/Series of data type Int64 or Float64 if fractional is set.
Truncate
Truncate a datetime to the nearest multiple of a given duration.
member Truncate(every: Dur) : SeriesParameters
| Name | Type | Description |
|---|---|---|
every | Dur | The duration to truncate to. |
Returns: Expression/Series of data type Date or Datetime.
Weekday
Get the weekday from the underlying date/datetime.
member Weekday : unit -> SeriesReturns: Expression/Series of data type Int32.
Year
Get the year from the underlying date/datetime.
member Year : unit -> SeriesReturns: Expression/Series of data type Int32.