title: Selecting Data from Last Week in Python
body: <p>I have a large database and I am looking to read only the last week for my python code. </p>
  
  <p>My first problem is that the column with the received date and time is not in the format for datetime in pandas. My input (Column 15) looks like this:</p>
  
  <pre><code>recvd_dttm
  1/1/2015 5:18:32 AM
  1/1/2015 6:48:23 AM
  1/1/2015 13:49:12 PM
  </code></pre>
  
  <p>From the Time Series / Date functionality in the pandas library I am looking at basing my code off of the "Week()" function shown in the example below:</p>
  
  <pre><code>In [87]: d
  Out[87]: datetime.datetime(2008, 8, 18, 9, 0)
  
  In [88]: d - Week()
  Out[88]: Timestamp('2008-08-11 09:00:00')
  </code></pre>
  
  <p>I have tried ordering the date this way:</p>
  
  <pre><code>df =pd.read_csv('MYDATA.csv')
  orderdate = datetime.datetime.strptime(df['recvd_dttm'], '%m/%d/%Y').strftime('%Y %m %d')
  </code></pre>
  
  <p>however I am getting this error </p>
  
  <pre><code>TypeError: must be string, not Series
  </code></pre>
  
  <p>Does anyone know a simpler way to do this, or how to fix this error? </p>
  
  <p>Edit: The dates are not necessarily in order. AND sometimes there is a faulty error in the database like a date that is 9/03/2015 (in the future) someone mistyped. I need to be able to ignore those.</p>