title: drop rows based on dates
body: <p>Hello Python Experts,
  I import data into a python dataframe from a csv file which goes through April 2021. But then I want to drop any data after 2019. Playing around with the data.drop() feature, but cant' seem to figure out the syntax. How do i drop all data after 2019 in the dataframe?</p>
  <p>Please see my code and csv file (form which the dataframe is being created) and advice. Thanks!
  import pandas as pd
  import datetime
  import matplotlib.pyplot as plt</p>
  <pre><code>if __name__ == '__main__':
  index_data =pd.read_csv('CSUSHPISA.csv')
  index_data['DATE'] =pd.to_datetime(index_data['DATE'])
  index_data.set_index('DATE', inplace=True)
  
  print(index_data)
  </code></pre>
  <p>Current result:<br />
  <a href="https://i.stack.imgur.com/dY9oK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dY9oK.png" alt="enter image description here" /></a></p>
  <p>data.drop()????</p>