gs_quant.datetime.date.business_day_count — gs_quant 0.1 documentation

# gs_quant.datetime.date.business_day_count

`business_day_count`(begin_dates, end_dates, calendars=(), week_mask=None)

  Determine the number of business days between begin_dates and end_dates

  Parameters

    - begin_dates (`Union`[`date`, `Iterable`[`date`]]) – A date or collection of beginning dates

    - end_dates (`Union`[`date`, `Iterable`[`date`]]) – A date or collection of end dates

    - calendars (`Union`[`str`, `Tuple`[`str`, …]]) – Calendars to use for holidays

    - week_mask (`Optional`[`str`]) – Which days are considered weekends (defaults to Saturday and Sunday)

  Return type

    `Union`[`int`, `Tuple`[`int`]]

  Returns

    An int or tuple of ints, representing the number of business days between begin_dates and end_dates

  Examples

      >>> import datetime as dt
      >>> today = dt.date.today()
      >>> bus_days = business_day_count(today, today + dt.timedelta(days=7))