title: Bring a list of users back and forth after skipping certain iterations
body: <p>I am doing some analysis in which I am applying a certain filter to remove certain users who have seen a particular content(tactic). </p>
  
  <p>The original dataframe looks like:</p>
  
  <pre><code>user content response
  
  100   esample  0
  101   esample  1
  .................
  106   esample  0
  </code></pre>
  
  <p>Now this dataframe is simulated in various iterations. So in every iteration we have different dataset with same columns. Now at every iteration I want to filter  the users who have seen 'esample' and bring them after two subsequent iterations. For instance users in tactic1_list(those who have seen esample) should not be considered for analysis in 3rd and 4th iteration. They are brought again in analysis in 5th iteration. </p>
  
  <pre><code>for i in range(2,10): 
  #Apply a filter on original dataframe(df) and create a list at each iteration
  #segregate those users who have seen a Esample content
  tactic1_list=df.loc[(df.tactic=='Esample') &amp; (df.response &gt; 0)]['muid'].tolist()
  # exclude these users from original dataframe
  tactic1_sample_muids= list(set(df.muid).difference(tactic1_list))
  ###Further analysis
  </code></pre>
  
  <p>Now I want  to code in such a way such that the users in tactic1_list should be used again after subsequent 2 iterations. I was thinking to use continue, but not sure how to do that. Any help would be appreciated.</p>