title: Format the color of a cell in a pandas dataframe according to multiple conditions
body: <p>I am trying to format the color of a cell of an specific column in a data frame, but I can't manage to do it according to multiple conditions.</p>
  
  <p>This is my dataframe (df):</p>
  
  <pre><code>    Name     ID         Cel     Date
  0   Diego   b000000005  7878    2565-05-31 20:53:00
  1   Luis    b000000015  6464    2017-05-11 20:53:00
  2   Vidal   b000000002  1100    2017-05-08 20:53:00
  3   John    b000000011  4545    2017-06-06 20:53:00
  4   Yusef   b000000013  1717    2017-06-06 20:53:00
  </code></pre>
  
  <p>I want the values in the "Date" column to change color according to the following conditions:</p>
  
  <pre><code> if date &lt; datetime.now():
          color = 'green'
      elif date &gt; datetime.now():
          date = 'yellow'
      elif date &gt; (datetime.now() + timedelta(days=60)):
          color = 'red'
  </code></pre>
  
  <p>This is my current code:</p>
  
  <pre><code>def color(val):
      if val &lt; datetime.now():
          color = 'green'
      elif val &gt; datetime.now():
          color = 'yellow'
      elif val &gt; (datetime.now() + timedelta(days=60)):
          color = 'red'
      return 'background-color: %s' % color
  
  df.style.apply(color, subset = ['Fecha'])
  </code></pre>
  
  <p>I am getting the following error:</p>
  
  <blockquote>
    <p>ValueError: ('The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().', 'occurred at index Fecha')</p>
  </blockquote>
  
  <p>The output is:</p>
  
  <pre><code>Out[65]: &lt;pandas.formats.style.Styler at 0x1e3ab8dec50&gt;
  </code></pre>
  
  <p>Any help will be appreciated.</p>