title: How to change data frame by getting some specific rows repeated?
body: <pre><code>    a      b     c             d
     5015  3.49 1059.500       0.00
     5023  2.50 6056.000       2.50
     5024  3.00 1954.500       3.00
     5026  3.49 1163.833       0.00
     5037  2.50 6797.000       2.50
     5038  3.00 2109.000       3.00
     5040  2.50 4521.000       2.50
     5041  3.33 2469.000       3.33
  </code></pre>
  
  <p>I want to repeat previously observed row with column 0 before a row non zero value of d. so, I will get rows with alternate rows of row with zero value of d then non zero value of d. a row with zero value of d must be previously observed row.</p>
  
  <p>Output I want is:</p>
  
  <pre><code>   a     b    c              d      
  
    5015  3.49 1059.500       0.00    
    5023  2.50 6056.000       2.50    
    5015  3.49 1059.500       0.00    
    5024  3.00 1954.500       3.00    
    5026  3.49 1163.833       0.00    
    5037  2.50 6797.000       2.50    
    5026  3.49 1163.833       0.00    
    5038  3.00 2109.000       3.00    
    5026  3.49 1163.833       0.00    
    5040  2.50 4521.000       2.50    
    5026  3.49 1163.833       0.00    
    5041  3.33 2469.000       3.33    
  </code></pre>