title: Python Pandas.Series.asof: Cannot compare type 'Timestamp' with type 'struct_time'
body: <p>I'm encountering a problem passing a <code>datetime</code> into a <code>Pandas.Series.asof</code>:</p>
  
  <pre><code>def valueAsOf(self, date):
      if type(date) is str:
          return time.strptime(date, '%Y%m%d')
      return self.__series.index.asof(date)
  </code></pre>
  
  <p>and the following error occurs</p>
  
  <pre><code>Traceback (most recent call last):
    File "/Users/x/test.py", line 106, in &lt;module&gt;
      print someTs.series.asof('20150101')
    File "/Users/x/anaconda/envs/test/lib/python2.7/site-packages/pandas/core/series.py", line 2460, in asof
      if where &lt; start:
    File "pandas/tslib.pyx", line 836, in pandas.tslib._Timestamp.__richcmp__ (pandas/tslib.c:15612)
  TypeError: Cannot compare type 'Timestamp' with type 'struct_time'
  </code></pre>
  
  <p>Currently the index of the <code>pandas.Series</code> is <code>&lt;type 'time.struct_time'&gt;
  </code></p>
  
  <p>Will the problem be solved by converting <code>date</code> from <code>struct_time</code> to <code>Timestamp</code>? If so, how can this be done?</p>
  
  <hr>
  
  <p>I tried converting <code>date</code> to a <code>datetime</code> object but still received the same error message, even though <code>type(dt)</code> shows that its <code>&lt;type 'datetime.datetime'&gt;</code></p>
  
  <pre><code>dt = datetime.fromtimestamp(mktime(date))
  return self.__series.index.asof(dt)
  </code></pre>