title: Add business days to pandas dataframe with dates and skip over holidays python
body: <p>I have a dataframe with dates as seen in the table below. 1st block is what it should look like and the 2nd block is what I get when just adding the BDays. This is an example of what it should look like when completed. I want to use the 1st column and add 5 business days to the dates, but if the 5 Bdays overlaps a holiday (like 15 Feb'21) then I need to add one additional day. It is fairly simple to add the 5Bday using  <code>pandas.tseries.offsets import BDay</code>, but i cannot skip the holidays while using the dataframe.</p>
  <p>I have tried to use <code>pandas.tseries.holiday import USFederalHolidayCalendar</code>, the workdays and workalendar modules, but cannot figure it out. Anyone have an idea what I can do.</p>
  <p>Correct Example</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>DATE</th>
  <th>EXIT DATE +5</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>2021/02/09</td>
  <td>2021/02/17</td>
  </tr>
  <tr>
  <td>2021/02/10</td>
  <td>2021/02/18</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Wrong Example</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>DATE</th>
  <th>EXIT DATE +5</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>2021/02/09</td>
  <td>2021/02/16</td>
  </tr>
  <tr>
  <td>2021/02/10</td>
  <td>2021/02/17</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Here are some examples of code I tried:</p>
  <pre><code>import pandas as pd
  from workdays import workday
  ...
  df['DATE'] = workday(df['EXIT DATE +5'], days=5, holidays=holidays)
  </code></pre>
  <p>Next Example:</p>
  <pre><code>import pandas as pd
  from pandas.tseries.holiday import USFederalHolidayCalendar
  bday_us = pd.offsets.CustomBusinessDay(calendar=USFederalHolidayCalendar())
  dt = df['DATE']
  df['EXIT DATE +5'] = dt + bday_us
  </code></pre>
  <p>=========================================</p>
  <p><strong>Final code:</strong></p>
  <p>Below is the code I finally settled on. I had to define the holidays manually due to the days the NYSE actually trades. Like for instance the day Pres Bush was laid to rest.</p>
  <pre><code>import datetime as dt
  import pandas as pd
  from pandas.tseries.holiday import USFederalHolidayCalendar
  from pandas.tseries.offsets import BDay
  
  from pandas.tseries.holiday import AbstractHolidayCalendar, Holiday, nearest_workday, \
      USMartinLutherKingJr, USPresidentsDay, GoodFriday, USMemorialDay, \
      USLaborDay, USThanksgivingDay
  
  class USTradingCalendar(AbstractHolidayCalendar):
      rules = [
          Holiday('NewYearsDay', month=1, day=1, observance=nearest_workday),
          USMartinLutherKingJr,
          USPresidentsDay,
          GoodFriday,
          USMemorialDay,
          Holiday('USIndependenceDay', month=7, day=4, observance=nearest_workday),
          Holiday('BushDay', year=2018, month=12, day=5),
          USLaborDay,
          USThanksgivingDay,
          Holiday('Christmas', month=12, day=25, observance=nearest_workday)
      ]
  
  offset = 5
  
  df = pd.DataFrame(['2019-10-11', '2019-10-14', '2017-04-13', '2018-11-28', '2021-07-02'], columns=['DATE'])
  df['DATE'] = pd.to_datetime(df['DATE'])
  
  def offset_date(start, offset):
    return start + pd.offsets.CustomBusinessDay(n=offset, calendar=USTradingCalendar())
  
  df['END'] = df.apply(lambda x: offset_date(x['DATE'], offset), axis=1)
  print(df)
  </code></pre>