Skip to content

datetime

DatetimeMethods

DatetimeMethods(series)

Class that provides datetime methods to series.

Parameters:

  • series (Series) –

    Series to be used.

FREQUENCY_MAPPING class-attribute instance-attribute

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

year property

year

Returns a series with year of date.

Applies YEAR operator to column.

Returns:

  • Series

    A series containing year of given date.

quarter property

quarter

Returns a series with quarter of date.

Applies QUARTER operator to column.

Returns:

  • Series

    A series containing quarter of given date.

month property

month

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

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

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

Returns a series with day of date.

Applies DAY operator to column.

Returns:

  • Series

    A series containing day of given date.

hour property

hour

Returns a series with hour of date.

Applies HOURS operator to column.

Returns:

  • Series

    A series containing hour of given date.

minute property

minute

Returns a series with minute of date.

Applies MINUTES operator to column.

Returns:

  • Series

    A series containing minute of given date.

second property

second

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.