Skip to content

Commit c8b3337

Browse files
authored
Clarify relation between DateOffset and relativedelta (#42251)
dateutil.relativedelta can be constructed either from two date/datetime objects passed as positional arguments, or explicitly constructed in terms of year, month, day etc passed as keyword arguments. DateOffset only supports the keyword argument form of relativedelta.
1 parent 2499a76 commit c8b3337

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pandas/_libs/tslibs/offsets.pyx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,12 +1152,13 @@ class DateOffset(RelativeDeltaOffset, metaclass=OffsetMeta):
11521152
"""
11531153
Standard kind of date increment used for a date range.
11541154
1155-
Works exactly like relativedelta in terms of the keyword args you
1156-
pass in, use of the keyword n is discouraged-- you would be better
1155+
Works exactly like the keyword argument form of relativedelta.
1156+
Note that the positional argument form of relativedelata is not
1157+
supported. Use of the keyword n is discouraged-- you would be better
11571158
off specifying n in the keywords you use, but regardless it is
11581159
there for you. n is needed for DateOffset subclasses.
11591160
1160-
DateOffset work as follows. Each offset specify a set of dates
1161+
DateOffset works as follows. Each offset specify a set of dates
11611162
that conform to the DateOffset. For example, Bday defines this
11621163
set to be the set of dates that are weekdays (M-F). To test if a
11631164
date is in the set of a DateOffset dateOffset we can use the

0 commit comments

Comments
 (0)