title: Pandas how to add additional values between two row-values in a dataframe
body: <p>I have a melted data frame. Under the same index, I have &quot;early_date&quot; &amp; &quot;latest_date&quot;, which are in &quot;int&quot; dtype. I want to create additional values in between the &quot;early_date&quot; &amp; &quot;latest_date&quot; row-values. Incidentally, I want to stack the generated values into new rows between them.</p>
  <p>For example, under 5021 index, I want to add a Middle value between &quot;early_date&quot; &amp; &quot;latest_date&quot; --&gt; 201729 &amp; 201731. And the Middle value will be under the same index 5021, and it is simply 201730 .</p>
  <p>However, the gap between &quot;early_date&quot; &amp; &quot;latest_date&quot; may vary within 5. For example, under the same index, &quot;early_date&quot; &amp; &quot;latest_date&quot; --&gt; 201730 &amp; 201733. Then, the Middle values that I need to insert will be 201731 &amp; 201732.</p>
  <p>Are there any ways to perform this operation? * The index (date) can be ignored</p>
  <p><a href="https://i.stack.imgur.com/wySnD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wySnD.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/fVi69.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fVi69.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/rrQZp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rrQZp.png" alt="This is the original dataframe, I want to split &quot;VOL&quot; evenly between the date range of &quot;early_date&quot; &amp; &quot;latest_date&quot;. E.g. I want to spread the VOL =2 to 2/3 when the &quot;early_date&quot; &amp; &quot;latest_date&quot; ==  201729 &amp; 201731" /></a></p>
  <p>This is the original dataframe, I want to split &quot;VOL&quot; evenly between the date range of &quot;early_date&quot; &amp; &quot;latest_date&quot;. E.g. In index 5021, I want to spread the VOL from 2 to 2/3 when the &quot;early_date&quot; &amp; &quot;latest_date&quot; ==  201729 &amp; 201731. Also show 201730 in the dataframe</p>