pandas.tseries.offsets.LastWeekOfMonth#

class pandas.tseries.offsets.LastWeekOfMonth#

Describes monthly dates in last week of month.

For example “the last Tuesday of each month”.

Parameters:
nint, default 1

The number of months represented.

normalizebool, default False

Normalize start/end dates to midnight before generating date range.

weekdayint {0, 1, …, 6}, default 0

A specific integer for the day of the week.

  • 0 is Monday

  • 1 is Tuesday

  • 2 is Wednesday

  • 3 is Thursday

  • 4 is Friday

  • 5 is Saturday

  • 6 is Sunday.

Attributes

week

Return the week of the month on which this offset applies.

weekday

Return the day of the week on which this offset applies.

See also

tseries.offsets.WeekOfMonth

Date offset for a specific weekday in a month.

tseries.offsets.MonthEnd

Date offset for the end of the month.

tseries.offsets.BMonthEnd

Date offset for the last business day of the month.

Examples

>>> ts = pd.Timestamp(2022, 1, 1)
>>> ts + pd.offsets.LastWeekOfMonth()
Timestamp('2022-01-31 00:00:00')