Dates, times, timestamps and intervals.

TimeValue

TimeValue(self, arg)

Methods

NameDescription
hourExtract the hour component.
microsecondExtract the microsecond component.
millisecondExtract the millisecond component.
minuteExtract the minute component.
secondExtract the second component.
timeReturn the time component of the expression.
truncateTruncate 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

NameTypeDescription
TimeValueThe 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

NameTypeDescriptionDefault
unitLiteral[‘h’, ‘m’, ‘s’, ‘ms’, ‘us’, ‘ns’]The unit to truncate torequired

Returns

NameTypeDescription
TimeValueself truncated to unit

DateValue

DateValue(self, arg)

Methods

NameDescription
dayExtract the day component.
day_of_yearExtract the day of the year component.
epoch_secondsExtract UNIX epoch in seconds.
monthExtract the month component.
quarterExtract the quarter component.
truncateTruncate date expression to units of unit.
week_of_yearExtract the week of the year component.
yearExtract 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

NameTypeDescriptionDefault
unitLiteral[‘Y’, ‘Q’, ‘M’, ‘W’, ‘D’]Unit to truncate arg torequired

Returns

NameTypeDescription
DateValueTruncated 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

NameDescription
full_nameGet the name of the day of the week.
indexGet the index of the day of the week.

full_name

full_name()

Get the name of the day of the week.

Returns

NameTypeDescription
StringValueThe name of the day of the week

index

index()

Get the index of the day of the week.

Ibis follows the pandas convention for day numbering: Monday = 0 and Sunday = 6.

Returns

NameTypeDescription
IntegerValueThe index of the day of the week.

TimestampValue

TimestampValue(self, arg)

Methods

NameDescription
dateReturn the date component of the expression.
truncateTruncate timestamp expression to units of unit.

date

date()

Return the date component of the expression.

Returns

NameTypeDescription
DateValueThe date component of self

truncate

truncate(unit)

Truncate timestamp expression to units of unit.

Parameters

NameTypeDescriptionDefault
unitLiteral[‘Y’, ‘Q’, ‘M’, ‘W’, ‘D’, ‘h’, ‘m’, ‘s’, ‘ms’, ‘us’, ‘ns’]Unit to truncate torequired

Returns

NameTypeDescription
TimestampValueTruncated timestamp expression

IntervalValue

IntervalValue(self, arg)

Methods

NameDescription
to_unit

to_unit

to_unit(target_unit)