title: Comparing datetime.time and pd.TimeStamp in Python
body: <p>I have a dataset with <code>pd.TimeStamp</code> data contained in a <code>CRASH TIME</code> column, e.g. <code>Timestamp('2017-06-26 22:00:00')</code>. I created a new column called <code>SUNRISE</code> which contains <code>datetime</code> data, e.g. <code>datetime.time(5, 26, 50, 135154)</code>.</p>
  <p>I'd like to compare the times of <code>CRASH TIME</code> and <code>SUNRISE</code> to determine if the times in <code>CRASH TIME</code> are before or after sunrise. When I try to do this via the following:</p>
  <pre><code>df['DAYTIME'] = 0
  after_sunrise = df['CRASH TIME'] &gt; df['SUNRISE']
  df.loc[after_sunrise == True, 'DAYTIME'] = 1
  </code></pre>
  <p>I receive an error: <code>TypeError: '&gt;' not supported between instances of 'Timestamp' and 'datetime.time'</code>. How can I compare <code>pd.TimeStamp</code> and <code>datetime.time</code>? I know I can perform an <code>apply()</code> with the techniques found <a href="https://www.programiz.com/python-programming/datetime/timestamp-datetime" rel="nofollow noreferrer">here</a>, but I feel like there's a more pandas-oriented method.</p>