title: How to replace the current rows with previous rows
body: <p>I have data frame df as below and I want to impute the zeroes with previous four rows.</p>
  <p>I tried below code but did not work for me</p>
  <pre><code>       df.loc [7:11] = df.loc [3:7] 
  </code></pre>
  <p><a href="https://i.stack.imgur.com/Cw5l8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Cw5l8.png" alt="enter image description here" /></a></p>