title: Python: If statement return ValueError
body: <p>I create a if statement with pandas and return error as below:</p>
  
  <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>
  
  <p>My code is as below:</p>
  
  <pre><code>&gt;&gt;&gt; df_1
      timestamp  open  high   low  close  adjusted_close  volume  \
  0  2017-09-01  1.17  1.24  1.16    1.2             1.2   47932   
     dividend_amount  split_coefficient  
  0              0.0                1.0  
  &gt;&gt;&gt; df_o
     timestamp  open  high   low  close  adjusted_close  volume  \
  0  2017-08-31  1.15  1.27  1.06    1.29             1.29   97932   
     dividend_amount  split_coefficient  
  0              0.0                1.0  
  &gt;&gt;&gt;if df_1['timestamp']!= df_o['timestamp'].tail(1):
  ....    print "different date"
  &gt;&gt;&gt;&gt;Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/home/vinus/.local/lib/python2.7/site-packages/pandas/core/generic.py", line 892, in __nonzero__
      .format(self.__class__.__name__))
  ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). 
  </code></pre>
  
  <p>How can I avoid the error?
  It is cause by <code>if df_1['timestamp']!= df_o['timestamp'].tail(1):</code></p>