Temporal expressions
Dates, times, timestamps and intervals.
TimeValue
TimeValue(self, arg)
Methods
Name | Description |
---|---|
hour | Extract the hour component. |
microsecond | Extract the microsecond component. |
millisecond | Extract the millisecond component. |
minute | Extract the minute component. |
second | Extract the second component. |
time | Return the time component of the expression. |
truncate | Truncate the expression to a time expression in units of unit . |
hour
hour()
Extract the hour component.
microsecond
microsecond()
Extract the microsecond component.
millisecond
millisecond()
Extract the millisecond component.
minute
minute()
Extract the minute component.
second
second()
Extract the second component.
time
time()
Return the time component of the expression.
Returns
Type | Description |
---|---|
TimeValue | The time component of self |
truncate
truncate(unit)
Truncate the expression to a time expression in units of unit
.
Commonly used for time series resampling.
Parameters
Name | Type | Description | Default |
---|---|---|---|
unit |
Literal[‘h’, ‘m’, ‘s’, ‘ms’, ‘us’, ‘ns’] | The unit to truncate to | required |
Returns
Type | Description |
---|---|
TimeValue | self truncated to unit |
DateValue
DateValue(self, arg)
Methods
Name | Description |
---|---|
day | Extract the day component. |
day_of_year | Extract the day of the year component. |
epoch_seconds | Extract UNIX epoch in seconds. |
month | Extract the month component. |
quarter | Extract the quarter component. |
truncate | Truncate date expression to units of unit . |
week_of_year | Extract the week of the year component. |
year | Extract the year component. |
day
day()
Extract the day component.
day_of_year
day_of_year()
Extract the day of the year component.
epoch_seconds
epoch_seconds()
Extract UNIX epoch in seconds.
month
month()
Extract the month component.
quarter
quarter()
Extract the quarter component.
truncate
truncate(unit)
Truncate date expression to units of unit
.
Parameters
Name | Type | Description | Default |
---|---|---|---|
unit |
Literal[‘Y’, ‘Q’, ‘M’, ‘W’, ‘D’] | Unit to truncate arg to |
required |
Returns
Type | Description |
---|---|
DateValue | Truncated date value expression |
week_of_year
week_of_year()
Extract the week of the year component.
year
year()
Extract the year component.
DayOfWeek
DayOfWeek(self, expr)
A namespace of methods for extracting day of week information.
Methods
Name | Description |
---|---|
full_name | Get the name of the day of the week. |
index | Get the index of the day of the week. |
full_name
full_name()
Get the name of the day of the week.
Returns
Type | Description |
---|---|
StringValue | The name of the day of the week |
index
index()
Get the index of the day of the week.
pandas
convention for day numbering: Monday = 0 and Sunday = 6.
Returns
Type | Description |
---|---|
IntegerValue | The index of the day of the week. |
TimestampValue
TimestampValue(self, arg)
Methods
Name | Description |
---|---|
date | Return the date component of the expression. |
truncate | Truncate timestamp expression to units of unit . |
date
date()
Return the date component of the expression.
Returns
Type | Description |
---|---|
DateValue | The date component of self |
truncate
truncate(unit)
Truncate timestamp expression to units of unit
.
Parameters
Name | Type | Description | Default |
---|---|---|---|
unit |
Literal[‘Y’, ‘Q’, ‘M’, ‘W’, ‘D’, ‘h’, ‘m’, ‘s’, ‘ms’, ‘us’, ‘ns’] | Unit to truncate to | required |
Returns
Type | Description |
---|---|
TimestampValue | Truncated timestamp expression |
IntervalValue
IntervalValue(self, arg)
Methods
Name | Description |
---|---|
to_unit | Convert this interval to units of target_unit . |
to_unit
to_unit(target_unit)
Convert this interval to units of target_unit
.