|
16 | 16 | import pandas.compat as compat
|
17 | 17 | from pandas.compat import range
|
18 | 18 | from pandas.errors import AbstractMethodError
|
19 |
| -from pandas.util._decorators import cache_readonly |
| 19 | +from pandas.util._decorators import Appender, Substitution, cache_readonly |
20 | 20 |
|
21 | 21 | from pandas.core.dtypes.generic import ABCPeriod
|
22 | 22 |
|
@@ -972,21 +972,25 @@ class BusinessMonthBegin(MonthOffset):
|
972 | 972 |
|
973 | 973 | class _CustomBusinessMonth(_CustomMixin, BusinessMixin, MonthOffset):
|
974 | 974 | """
|
975 |
| - DateOffset subclass representing one custom business month, incrementing |
976 |
| - between [BEGIN/END] of month dates. |
| 975 | + DateOffset subclass representing custom business month(s). |
| 976 | +
|
| 977 | + The count increase between %(bound)s of month dates. |
977 | 978 |
|
978 | 979 | Parameters
|
979 | 980 | ----------
|
980 | 981 | n : int, default 1
|
| 982 | + The number of months represented. |
981 | 983 | normalize : bool, default False
|
982 |
| - Normalize start/end dates to midnight before generating date range |
| 984 | + Normalize start/end dates to midnight before generating date range. |
983 | 985 | weekmask : str, Default 'Mon Tue Wed Thu Fri'
|
984 |
| - weekmask of valid business days, passed to ``numpy.busdaycalendar`` |
| 986 | + Weekmask of valid business days, passed to ``numpy.busdaycalendar``. |
985 | 987 | holidays : list
|
986 |
| - list/array of dates to exclude from the set of valid business days, |
987 |
| - passed to ``numpy.busdaycalendar`` |
| 988 | + List/array of dates to exclude from the set of valid business days, |
| 989 | + passed to ``numpy.busdaycalendar``. |
988 | 990 | calendar : pd.HolidayCalendar or np.busdaycalendar
|
| 991 | + A business day calendar. |
989 | 992 | offset : timedelta, default timedelta(0)
|
| 993 | + Applies an offset counted in valid days. |
990 | 994 | """
|
991 | 995 | _attributes = frozenset(['n', 'normalize',
|
992 | 996 | 'weekmask', 'holidays', 'calendar', 'offset'])
|
@@ -1053,18 +1057,15 @@ def apply(self, other):
|
1053 | 1057 | return result
|
1054 | 1058 |
|
1055 | 1059 |
|
| 1060 | +@Substitution(bound="end") |
| 1061 | +@Appender(_CustomBusinessMonth.__doc__) |
1056 | 1062 | class CustomBusinessMonthEnd(_CustomBusinessMonth):
|
1057 |
| - # TODO(py27): Replace condition with Subsitution after dropping Py27 |
1058 |
| - if _CustomBusinessMonth.__doc__: |
1059 |
| - __doc__ = _CustomBusinessMonth.__doc__.replace('[BEGIN/END]', 'end') |
1060 | 1063 | _prefix = 'CBM'
|
1061 | 1064 |
|
1062 | 1065 |
|
| 1066 | +@Substitution(bound="beginning") |
| 1067 | +@Appender(_CustomBusinessMonth.__doc__) |
1063 | 1068 | class CustomBusinessMonthBegin(_CustomBusinessMonth):
|
1064 |
| - # TODO(py27): Replace condition with Subsitution after dropping Py27 |
1065 |
| - if _CustomBusinessMonth.__doc__: |
1066 |
| - __doc__ = _CustomBusinessMonth.__doc__.replace('[BEGIN/END]', |
1067 |
| - 'beginning') |
1068 | 1069 | _prefix = 'CBMS'
|
1069 | 1070 |
|
1070 | 1071 |
|
|
0 commit comments