title: Pandas: Generating datetime between two times and pass the result as new rows in the data frame
body: <p>I am working on a data frame <code>df</code> with the following structure:</p>
  
  <pre><code>   start_time            end_time                key            vol
  0  2018-08-23 00:00:00   2018-08-23 01:30:00     abcd_eg        0.92
  1  2018-08-23 00:15:00   2018-08-23 01:45:00     defg_x2        0.27
  </code></pre>
  
  <p>I am trying to generate a 15 minute interval between a start and an end time. I would like to have to result as new rows in the same dataframe (or a new dataframe) as follows: </p>
  
  <pre><code> start_time            end_time                  key             vol
  0  2018-08-23 00:00:00   2018-08-23 01:30:00     abcd_eg         0.92
  1  2018-08-23 00:15:00   2018-08-23 01:30:00     abcd_eg         0.92
  2  2018-08-23 00:30:00   2018-08-23 01:30:00     abcd_eg         0.92
  3  2018-08-23 00:45:00   2018-08-23 01:30:00     abcd_eg         0.92
  4  2018-08-23 01:00:00   2018-08-23 01:30:00     abcd_eg         0.92
  5  2018-08-23 01:15:00   2018-08-23 01:30:00     abcd_eg         0.92
  6  2018-08-23 01:30:00   2018-08-23 01:30:00     abcd_eg         0.92
  7  2018-08-23 00:15:00   2018-08-23 01:45:00     defg_x2         0.27
  8  2018-08-23 00:30:00   2018-08-23 01:45:00     defg_x2         0.27
  9  2018-08-23 00:45:00   2018-08-23 01:45:00     defg_x2         0.27
  10 2018-08-23 01:00:00   2018-08-23 01:45:00     defg_x2         0.27
  11 2018-08-23 01:15:00   2018-08-23 01:45:00     defg_x2         0.27
  12 2018-08-23 01:30:00   2018-08-23 01:45:00     defg_x2         0.27
  13 2018-08-23 01:45:00   2018-08-23 01:45:00     defg_x2         0.27
  </code></pre>
  
  <p>The date columns are of type <code>datetime[64]</code>, key is <code>object</code> and vol is <code>float</code>.
  What I tried till now is:</p>
  
  <pre><code>b=[]
  lst = []
  for i, row in df.iterrows():
  b = pd.date_range(start=row.start_time, end=row.end_time, freq='15min',closed=None)
  lst.append(b)
  </code></pre>
  
  <p>Used <code>.iterrows()</code> as I have about 125 records. This gives me the timeseries as <code>DatetimeIndex</code> for all the values of start and the end time in the dataframe, with 15 minute intervals. </p>
  
  <p>After this, I tried to pass <code>lst</code> as a new column <code>unpack</code> in the dataframe <code>df</code> as follows:</p>
  
  <pre><code>df['unpack'] = lst
  </code></pre>
  
  <p>My thoughts were that if I could get these values as the new column in df, I could use this <a href="https://stackoverflow.com/questions/50731229/split-cell-into-multiple-rows-in-pandas-dataframe">solution</a> to extract them as rows. But this process is not working. </p>
  
  <p>How can I do this with pandas? </p>