title: Resample pandas dataframe for how=median with missing values
body: <p>I've got this silly problem that I just can't seem to get my head around. I'm trying to resample a pandas dataframe using medians, but it just spits out errors like:</p>
  
  <pre><code>ValueError: Wrong number of items passed 81, placement implies 80
  </code></pre>
  
  <p>or </p>
  
  <pre><code>ValueError: Shape of passed values is (1, 3), indices imply (1, 2)
  </code></pre>
  
  <p>I'm not able (yet) to to reproduce the first error -- when I try to I get the second error so they seem to be "related enough". The following snippet will reproduce the second error:</p>
  
  <pre><code>data = {'state': ['Ohio', 'Ohio', 'Ohio', 'Nevada', 'Nevada'], 
  'datetime': [pd.datetime(2008, 10, 30, 0, 0), np.nan, pd.datetime(2008, 11, 2, 0, 0), pd.datetime(2008, 10, 30, 0, 0), pd.datetime(2008, 10, 30, 0, 0)],
  'pop': [1.5, 1.7, 3.6, 2.4, 2.9]}
  frame = pd.DataFrame(data)
  frame.set_index('datetime',inplace=True)
  frame.resample('M',how='mean')
  frame.resample('M',how='median')
  </code></pre>
  
  <p>Note that the first resample works - the mean - but the median doesn't. Any ideas about as to why, and how I would work around it to actually get medians would be great (if it's a problem with "median not defined for even number of values" I suppose the average of the two values in the middle would do for me).</p>
  
  <p>Thanks!</p>