title: How to check if a value exists in every forth or fifth row in Pandas?
body: <p>Salary is usually paid monthly, but suppose I have weekly data:</p>
  <pre><code>id   week   salary
  01     01      100
  01     02        0
  01     03        0
  01     04        0
  01     05        0
  01     06      100
  01     07        0
  01     08        0
  01     09        0
  01     10      100
   ⁝       ⁝        ⁝ 
  02     01        0
  02     02        0
  02     03        0
  02     04      150
  02     05        0
  02     06        0
  02     07        0
  02     08        0
  02     09        0
  02     10        0            
  </code></pre>
  <p>Since months are roughly 4.5 weeks, how can I make a binary employment column to check if the individual is employed (or has received salary in the next 4 or 5 weeks):</p>
  <pre><code>id   week   salary   employed
  01     01      100          1
  01     02        0          1
  01     03        0          1
  01     04        0          1
  01     05        0          1
  01     06      100          1
  01     07        0          1
  01     08        0          1            
  01     09        0          1
  01     10      100          1
   ⁝       ⁝        ⁝           ⁝
  02     01        0          1
  02     02        0          1
  02     03        0          1
  02     04      150          1
  02     05        0          0
  02     06        0          0 
  02     07        0          0
  02     08        0          0
  02     09        0          0
  02     10        0          0
  </code></pre>
  <p>Individuals <code>01</code> and <code>02</code> are paid monthly, so we expect them to have been employed for the past 5 weeks if they are paid in a given week.</p>
  <p>Edit: I have removed individual <code>03</code> to simplify the question.</p>