title: Pandas Resampling error: Only valid with DatetimeIndex or PeriodIndex
body: <p>When using panda's <code>resample</code> function on a DataFrame in order to convert tick data to OHLCV, a resampling error is encountered.</p>
  
  <p>How should we solve the error?</p>
  
  <pre><code>data = pd.read_csv('tickdata.csv', header=None, names=['Timestamp','Price','Volume']).set_index('Timestamp')
  data.head()
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/FvhPN.png" alt="enter image description here"></p>
  
  <pre><code># Resample data into 30min bins
  ticks = data.ix[:, ['Price', 'Volume']]
  bars = ticks.Price.resample('30min', how='ohlc')
  volumes = ticks.Volume.resample('30min', how='sum')
  </code></pre>
  
  <p>This gives the error:</p>
  
  <pre><code>TypeError: Only valid with DatetimeIndex or PeriodIndex
  </code></pre>