title: pandas rolling apply return np.nan
body: <p>I would like to apply a custom skewness function to rolling apply, but got np.nan instead.</p>
  <pre><code>import pandas as pd
  import numpy as np
  
  def _get_skewness(col, q=(0.05, 0.95)):
      if q[0] &gt; 0:
          quantiles = col.quantile(q)
          col.loc[(col&lt;quantiles[q[0]]) | (col &gt; quantiles[q[1]])] = np.nan
      skew = col.skew(axis=0, skipna=True)
      return skew
  
  df = pd.DataFrame(np.arange(40).reshape(-1, 2))
  
  df_skew = df.rolling(20, 10).apply(_get_skewness)
  print(df_skew)
  </code></pre>
  <p>I got the following result. I understand the first 10 rows are due to the rolling window min_period=10. Just don't get why the last few rows return np.nan as well.</p>
  <pre><code>      0    1
  0   NaN  NaN
  1   NaN  NaN
  2   NaN  NaN
  3   NaN  NaN
  4   NaN  NaN
  5   NaN  NaN
  6   NaN  NaN
  7   NaN  NaN
  8   NaN  NaN
  9   0.0  0.0
  10  0.0  0.0
  11  0.0  0.0
  12  0.0  0.0
  13  0.0  0.0
  14  0.0  0.0
  15  NaN  NaN
  16  NaN  NaN
  17  NaN  NaN
  18  NaN  NaN
  19  NaN  NaN
  </code></pre>