title: Pandas rolling: aggregate boolean values
body: <p>Is there any rolling "any" function in a pandas.DataFrame? Or is there any other way to aggregate boolean values in a rolling function?</p>
  
  <p>Consider:</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  
  s = pd.Series([True, True, False, True, False, False, False, True])
  
  # this works but I don't think it is clear enough - I am not
  # interested in the sum but a logical or!
  s.rolling(2).sum() &gt; 0  
  
  # What I would like to have:
  s.rolling(2).any()
  # AttributeError: 'Rolling' object has no attribute 'any'
  s.rolling(2).agg(np.any)
  # Same error! AttributeError: 'Rolling' object has no attribute 'any'
  </code></pre>
  
  <p>So which functions can I use when aggregating booleans? (if numpy.any does not work)
  The rolling documentation at <a href="https://pandas.pydata.org/pandas-docs/version/0.23.4/generated/pandas.DataFrame.rolling.html" rel="nofollow noreferrer">https://pandas.pydata.org/pandas-docs/version/0.23.4/generated/pandas.DataFrame.rolling.html</a> states that "a Window or Rolling sub-classed for the particular operation" is returned, which doesn't really help.</p>