title: Add Category Column Based On Date - Pandas Dataframe
body: <p>I have a dataframe with a column ORDER_DATE. I'm trying to add a new column for FISCAL_YEAR which essentially has this type of criteria:</p>
  
  <ul>
  <li>If between 7/1/16 and 6/30/17 = FY2017</li>
  <li>If between 7/1/17 and 6/30/18 = FY2018</li>
  </ul>
  
  <p>The only way I could think to do it is a series of conditional statements, which I am certain is not the most efficient or elegant. While my solution works as intended, it takes forever and I'm hoping for suggestions on how to make it better.</p>
  
  <pre><code>    #adds a fiscal year column to purchases
      purchases['FISCAL_YEAR'] = 'N/A'
      purchases['FISCAL_YEAR'][(purchases['ORDER_DATE'] &gt;= dt.datetime.strptime('2017-07-01', "%Y-%m-%d").date()) &amp; \
  (purchases['ORDER_DATE'] &lt;= dt.datetime.strptime('2018-06-30', "%Y-%m-%d").date())] = 'FY2017'
  
      purchases['FISCAL_YEAR'][(purchases['ORDER_DATE'] &gt;= dt.datetime.strptime('2017-07-01', "%Y-%m-%d").date()) &amp; \
  (purchases['ORDER_DATE'] &lt;= dt.datetime.strptime('2018-06-30', "%Y-%m-%d").date())] = 'FY2018'
  </code></pre>