title: Comparing dataframes date column values in Python?
body: <p>I want to compare 2 date columns between 2 dataframes.</p>
  <p>I have df1 and df2 and if the date in df1 &gt; df2 do some stuff.</p>
  <p>But when I tried</p>
  <pre class="lang-py prettyprint-override"><code>if df1['date'] &gt; df2['date']:
          print('some stuff')
  </code></pre>
  <p>It returns an error:</p>
  <blockquote>
  <p>ValueError: Can only compare identically-labeled Series objects</p>
  </blockquote>
  <p>Check the dates in both dfs are the same dtype = datetime64[ns]
  looks like 2019-01-10.</p>
  <p>Tried to reset indexes:</p>
  <pre class="lang-py prettyprint-override"><code>df1 = df1.reset_index(drop=True)
  df2 = df2.reset_index(drop=True)
  </code></pre>
  <p>But it didn't help</p>
  <p>No idea why it happens like this :(</p>
  <h1>Update</h1>
  <p>I also tried to set max date in df1 as a variable and compare df2['date'] with it, but it throws another error</p>
  <pre class="lang-py prettyprint-override"><code>max_date_df1 = df1['date'].max()
  
  df2['date'] &gt; max_date_df1 
  </code></pre>
  <blockquote>
  <p>ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().</p>
  </blockquote>