title: Rolling count of boolean values in a Python dataframe
body: <p>I want to count the number of True on a 4-day rolling basis in a python dataframe like the <code>CountTrue</code> column below. What is the most efficient way to do so? </p>
  
  <pre><code>        Boolean:     CountTrue:     
  2/01/19 True         3        
  1/31/19 True         2        
  1/30/19 False        1        
  1/29/19 True         1        
  1/28/19 False        1        
  1/27/19 False        2        
  1/26/19 False        2        
  1/25/19 True         2        
  1/24/19 True         NaN        
  1/23/19 False        NaN        
  1/22/29 False        NaN        
  </code></pre>