title: How can I put a specific condition for resampling in pandas dataframe?
body: <p>I have one three hourly time series dataframe. I want to calculate daily average by considering this condition 
  “ if there is more than 5 three hourly missing data in a day, consider that day as missing value”.</p>
  
  <p>For Example I have the following time series:</p>
  
  <pre><code>2007-01-01 00:00:00   NaN
  2007-01-01 03:00:00   NaN
  2007-01-01 06:00:00   NaN
  2007-01-01 09:00:00   NaN
  2007-01-01 12:00:00   NaN
  2007-01-01 15:00:00   NaN
  2007-01-01 18:00:00  39.2
  2007-01-01 21:00:00  43.2
  2007-01-02 00:00:00  41.9
  2007-01-02 03:00:00  40.6
  2007-01-02 06:00:00  40.2
  2007-01-02 09:00:00  39.3
  2007-01-02 12:00:00  39.5
  2007-01-02 15:00:00  39.6
  2007-01-02 18:00:00  38.0
  2007-01-02 21:00:00  38.0
  2007-01-03 00:00:00   NaN
  </code></pre>
  
  <p>What I got is:</p>
  
  <pre><code>df.resample('D',how='mean')            
  2007-01-01       **41.2000**
  2007-01-02       **39.6375**
  2007-01-03       **NaN**
  </code></pre>
  
  <p>What I am looking for is:</p>
  
  <pre><code>2007-01-01        **NaN**
  2007-01-02        **39.6375**
  2007-01-03        **NaN**
  </code></pre>
  
  <p>I would appreciate if anyone guides me. </p>
  
  <p>Thank you.</p>