title: moving average on previous calculated moving average
body: <p>I have a dataframe as below:</p>
  
  <pre><code>data = pd.DataFrame({'Date':['20191001','20191002','20191003','20191004','20191005','20191006','20191001','20191002','20191003','20191004','20191005','20191006'],'Store':['A','A','A','A','A','A','B','B','B','B','B','B'],'Sale':[1,2,8,6,9,0,4,3,0,2,3,7]})
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/ZCl35.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZCl35.png" alt="data"></a></p>
  
  <p>what I want to do is to calculate moving average for each store for 2 previous days (window size = 2) and put the value in a new column (let's say 'MA'), but the problem is that I want this window rolls over the actual sale and the previous calculated MA. the below image is the explanation:
  <a href="https://i.stack.imgur.com/6pGo5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6pGo5.png" alt="calculations"></a></p>
  
  <p>Sorry that I had to articulate my issue with picture :|</p>
  
  <p>I know I have to group by store and I can use the rolling(2) but the method would calculate the moving average on one column only. </p>
  
  <p>My original window is 15 and the above is just an example.</p>
  
  <p>Any help is kindly appreciated.</p>