title: Is there any elegant way to create irregular DatetimeIndex?
body: <p>Suppose that I have a list of trading dates: <code>[20180104, 20180105, 20180108, 20180109]</code>. There are two trading periods for each day: <code>[09:30, 11:30]</code> and <code>[13:00, 15:00]</code>. And I want to create a <code>pd.DatetimeIndex</code> include all trading intervals of frequency 30 minutes and closed by right, i.e. the result will be:</p>
  
  <pre><code>DatetimeIndex(['2018-01-04 10:00:00', '2018-01-04 10:30:00',
                 '2018-01-04 11:00:00', '2018-01-04 11:30:00',
                 '2018-01-04 13:30:00', '2018-01-04 14:00:00',
                 '2018-01-04 14:30:00', '2018-01-04 15:00:00',
                 '2018-01-05 10:00:00', '2018-01-05 10:30:00',
                 '2018-01-05 11:00:00', '2018-01-05 11:30:00',
                 '2018-01-05 13:30:00', '2018-01-05 14:00:00',
                 '2018-01-05 14:30:00', '2018-01-05 15:00:00',
                 '2018-01-08 10:00:00', '2018-01-08 10:30:00',
                 '2018-01-08 11:00:00', '2018-01-08 11:30:00',
                 '2018-01-08 13:30:00', '2018-01-08 14:00:00',
                 '2018-01-08 14:30:00', '2018-01-08 15:00:00',
                 '2018-01-09 10:00:00', '2018-01-09 10:30:00',
                 '2018-01-09 11:00:00', '2018-01-09 11:30:00',
                 '2018-01-09 13:30:00', '2018-01-09 14:00:00',
                 '2018-01-09 14:30:00', '2018-01-09 15:00:00'],
                dtype='datetime64[ns]', freq=None)
  </code></pre>
  
  <p>Here is my solution, but I am not satisfied with it：</p>
  
  <pre><code>In [17]: import pandas as pd
  In [18]: dates = pd.to_datetime([20180104, 20180105, 20180108, 20180109], format='%Y%m%d')
  In [19]: delta1 = pd.timedelta_range('9H30Min', '11H30Min', freq='30Min', closed='right')
  In [20]: delta2 = pd.timedelta_range('13H', '15H', freq='30Min', closed='right')
  
  In [21]: index = None
  In [22]: for date in dates:
      ...:     for delta in [delta1, delta2]:
      ...:         if index is None:
      ...:             index = date + delta
      ...:         else:
      ...:             index = index.append(date + delta)
      ...:             
  
  In [23]: index
  Out[23]: 
  DatetimeIndex(['2018-01-04 10:00:00', '2018-01-04 10:30:00',
                 '2018-01-04 11:00:00', '2018-01-04 11:30:00',
                 '2018-01-04 13:30:00', '2018-01-04 14:00:00',
  ...
  </code></pre>
  
  <p>Is there any more elegant way to solve this question? (ideally, without for loop)</p>