title: Python/Pandas resampling Forex tick data for tick volume
body: <p>I have a bunch of tick data that I can successfully resample into time data using:</p>
  
  <pre><code>h5_file = pd.HDFStore(h5_path)
  h5_file['fx_data'].groupby('Symbol')
  ask = grouped['Ask'].resample('5Min', how='ohlc')
  bid = grouped['Bid'].resample('5Min', how='ohlc')
  </code></pre>
  
  <p>But I would like to also return the tick volume.  This should just be a count of how many rows make up each sample.  How can this best be accomplished?</p>
  
  <p>Also - when I choose to resample with smaller timeframes there are occasionally bars where the values are N/A because there was no price changes for that period.  When this occurs I would like the previous close to be the value for OHLC on the current bar.</p>
  
  <p>I've searched and found this code:</p>
  
  <pre><code>whatev.groupby('Symbol')closes = resampledData['close'].fillna(method='pad')
  resampledData.apply(lambda x: x.fillna(closes)
  </code></pre>
  
  <p>I'm very new to Python and programming and don't understand lambas yet.  Will this change only the close values or all the values I need changed.  All help is greatly appreciated.</p>