title: Rolling apply function must be real number, not Nonetype
body: <p>I'm trying to use rolling and apply function to print window</p>
  
  <p>but I got the error says </p>
  
  <pre><code>File "pandas/_libs/window.pyx", line 1649, in pandas._libs.window.roll_generic
  TypeError: must be real number, not NoneType
  </code></pre>
  
  <p>My code is following </p>
  
  <pre><code>def print_window(window):
    print(window)
    print('==================')
  
  
  def example():
  
    df = pd.read_csv('window_example.csv')
  
    df.rolling(5).apply(print_window)
  </code></pre>
  
  <p>My data is like </p>
  
  <pre><code>number    sum   mean 
    1        1     1
    2        3     1.5
    3        6     2
    4       10     2.5
    5       15     3
    6       20     4
  </code></pre>
  
  <p>How should I slove this error? 
  I didn't find similar questions on this error </p>
  
  <p>Thanks !</p>