Skip to content

datetime

DatetimeMethods

DatetimeMethods(series)

Class that provides datetime methods to series.

Parameters:

  • series (Series) –

    Series to be used.

FREQUENCY_MAPPING instance-attribute class-attribute

FREQUENCY_MAPPING: Mapping[str, Type[UnaryPQLOperator]] = {
    "Y": RoundYearOperator,
    "A": RoundYearOperator,
    "Q": RoundQuarterOperator,
    "M": RoundMonthOperator,
    "W": RoundWeekOperator,
    "D": RoundDayOperator,
    "H": RoundHourOperator,
    "T": RoundMinuteOperator,
    "min": RoundMinuteOperator,
    "S": RoundSecondOperator,
}

year property

year: Series

Returns a series with year of date.

Applies YEAR operator to column.

Returns:

  • Series

    A series containing year of given date.

quarter property

quarter: Series

Returns a series with quarter of date.

Applies QUARTER operator to column.

Returns:

  • Series

    A series containing quarter of given date.

month property

month: Series

Returns a series with month of date.

Applies MONTH operator to column.

Returns:

  • Series

    A series containing month of given date.

week_of_year property

week_of_year: Series

Returns a series with week of year of date.

Applies CALENDAR_WEEK operator to column.

Returns:

  • Series

    A series containing week of year of given date.

day_of_week property

day_of_week: Series

Returns a series with day of week of date.

Applies DAY_OF_WEEK operator to column.

Returns:

  • Series

    A series containing day of week of given date.

day property

day: Series

Returns a series with day of date.

Applies DAY operator to column.

Returns:

  • Series

    A series containing day of given date.

hour property

hour: Series

Returns a series with hour of date.

Applies HOURS operator to column.

Returns:

  • Series

    A series containing hour of given date.

minute property

minute: Series

Returns a series with minute of date.

Applies MINUTES operator to column.

Returns:

  • Series

    A series containing minute of given date.

second property

second: Series

Returns a series with seconds of date.

Applies SECONDS operator to column.

Returns:

  • Series

    A series containing seconds of given date.

round

round(freq)

Rounds datetime series to given frequency.

Parameters:

  • freq (str) –

    Frequency to round datetime to. Supported frequencies are: Y, A: year Q: quarter M: month W: week D: day H: hour T, min: minute S: second

Returns:

  • Series

    A series rounded to given frequency.