title: Compare Pandas DatetimeIndex to a smaller DatetimeIndex with condition
body: <p>I am trying to compare two Pandas DatetineIndexs with different lengths.  I want to simply add a new column to my larger Dataframe (df) and place 1 where it matches the smaller DatetineIndex (events).</p>
  
  <p>I tried </p>
  
  <pre><code>df['filter'] = np.where(df.index == tEvents, 1, np.nan)
  </code></pre>
  
  <p>but I get "ValueError: Lengths must match to compare"</p>
  
  <p>I've been stuck here longer than I like to admit</p>
  
  <p><a href="https://i.stack.imgur.com/BUVgs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BUVgs.png" alt="Comparing different python datetime index with different lengths"></a></p>