title: Python Pandas compare date columns, check if not empty, conditional > <= logic, return value
body: <p>using Python3 Pandas, I'm trying to calculate RESULT. I keep getting Boolean ambiguous value errors. Do I need to test that each date column I compare with is not null first to avoid an error? The end result should mimic:</p>
  
  <pre><code>#check if D3_UNTIL is not empty
  if df.RUNNING_DATE.isna()==False:
      if df.D3_UNTIL.isna()==False:
          if.RUNNING_DATE &gt;= df.D3_UNTIL:
              df.RESULT = df.DVAL3
          elif (df.RUNNING_DATE &gt;= df.D2_UNTIL &amp; df.RUNNING_DATE &lt; df.D3_UNTIL):
              df.RESULT = df.DVAL2    
          elif (df.RUNNING_DATE &gt;= df.D1_UNTIL &amp; df.RUNNING_DATE &lt; df.D2_UNTIL):
              df.RESULT = df.DVAL1
          else None
  #check if D2.UNTIL is not empty
      elif df.D2_UNTIL.isna()==False:
          if.RUNNING_DATE &gt;= df.D2_UNTIL:
              df.RESULT = df.DVAL2
          elif (df.RUNNING_DATE &gt;= df.D1_UNTIL &amp; df.RUNNING_DATE &lt; df.D2_UNTIL):
              df.RESULT = df.DVAL1    
          else None
  #check if D1.UNTIL is not empty    
      elif df.D1_UNTIL.isna()==False:
          if.RUNNING_DATE &gt;= df.D1_UNTIL:
              df.RESULT = df.DVAL1
          else None
  else None
  
  
  
  RUNNING_DATE  D1_UNTIL  DVAL1  D2_UNTIL  DVAL2  D3_UNTIL  DVAL3  RESULT
  1/1/2018      1/1/2018  10                                       10             
  1/2/2018                                
  1/3/2018      1/1/2018                          
  1/4/2018      1/1/2018  10     1/3/2018  15             
  1/5/2018      1/1/2018  10     1/3/2018  20     1/31/2018 100    20 
  1/6/2018      1/1/2018  10               999                
  1/7/2018      1/1/2018  10     1/4/2018  25     1/6/2018  300    300    
  </code></pre>