xorbits.pandas.bdate_range#
- xorbits.pandas.bdate_range(start=None, end=None, periods: int | None = None, freq='B', tz=None, normalize: bool = True, name: Hashable = None, weekmask=None, holidays=None, closed: IntervalLeftRight | lib.NoDefault | None = _NoDefault.no_default, inclusive: IntervalClosedType | None = None, **kwargs) DatetimeIndex[source]#
Return a fixed frequency DatetimeIndex with business day as the default.
- Parameters
start (str or datetime-like, default None) – Left bound for generating dates.
end (str or datetime-like, default None) – Right bound for generating dates.
periods (int, default None) – Number of periods to generate.
freq (str or DateOffset, default 'B' (business daily)) – Frequency strings can have multiples, e.g. ‘5H’.
tz (str or None) – Time zone name for returning localized DatetimeIndex, for example Asia/Beijing.
normalize (bool, default False) – Normalize start/end dates to midnight before generating date range.
name (str, default None) – Name of the resulting DatetimeIndex.
weekmask (str or None, default None) – Weekmask of valid business days, passed to
numpy.busdaycalendar, only used when custom frequency strings are passed. The default value None is equivalent to ‘Mon Tue Wed Thu Fri’.holidays (list-like or None, default None) – Dates to exclude from the set of valid business days, passed to
numpy.busdaycalendar, only used when custom frequency strings are passed.closed (str, default None) –
Make the interval closed with respect to the given frequency to the ‘left’, ‘right’, or both sides (None).
Deprecated since version 1.4.0: Argument closed has been deprecated to standardize boundary inputs. Use inclusive instead, to set each bound as closed or open.
inclusive ({"both", "neither", "left", "right"}, default "both") –
Include boundaries; Whether to set each bound as closed or open.
New in version 1.4.0.
**kwargs – For compatibility. Has no effect on the result.
- Return type
DatetimeIndex
Notes
Of the four parameters:
start,end,periods, andfreq, exactly three must be specified. Specifyingfreqis a requirement forbdate_range. Usedate_rangeif specifyingfreqis not desired.To learn more about the frequency strings, please see this link.
Examples
Note how the two weekend days are skipped in the result.
>>> pd.bdate_range(start='1/1/2018', end='1/08/2018') DatetimeIndex(['2018-01-01', '2018-01-02', '2018-01-03', '2018-01-04', '2018-01-05', '2018-01-08'], dtype='datetime64[ns]', freq='B')
This docstring was copied from pandas.