title: How to extract specific set of date from a date column of an CSV file using Pandas?
body: <p>I want to access some specific values from the date column from my CSV file and save to another.</p>
  
  <p>here 'f' is the data frame of my csv file, "now" is the current date, "f['Date']"is the column which has to be manupilated, 
  LOGIC:</p>
  
  <p>if current day is monday then im subtracting 2 days from the current date and then storing it in "day" and accessing the dates in f['Date'] column which are equivalent to the "day" date.
  else we re subtracting only 1 day and doing the same.</p>
  
  <pre class="lang-py prettyprint-override"><code>now = date.today()
  curr_day= now.strftime("%A")
  now = now.strftime("%Y-%m-%d")
  
  f['Date'] = pd.to_datetime(f['Date'])
  # f['Date'] = f['Date'].apply( lambda x : x.strftime("%Y-%m-%d"))
  f['Date'] = f['Date'].astype(str)
  if curr_day == 'Monday':
  
      day = datetime.datetime.strptime(now,"%Y-%m-%d").date() - timedelta(days=2)
      day= day.strftime("%Y-%m-%d")
      f['Date']=f.loc[f['Date']==day]
  
  else:
  
      day = datetime.datetime.strptime(now,"%Y-%m-%d").date() - timedelta(days=1)
      day= day.strftime("%Y-%m-%d")
      f['Date']=f.loc[f['Date']==day]
  </code></pre>
  
  <p>I have a date lets say: DATE1 
  and I need to access only those values in the date column which are equivalent to the DATE1 and the save to the new CSV file.</p>
  
  <pre><code>Date
  01-Apr-19
  02-Apr-19
  03-Apr-19
  14-Apr-19
  18-Apr-19
  14-Apr-19
  14-Apr-19
  14-Apr-19
  01-Apr-19
  10-Apr-19
  01-Apr-19
  01-Apr-19
  </code></pre>
  
  <p>Assume DATE1=14-04-2019</p>
  
  <p>Then the updated CSV will look like</p>
  
  <pre><code>Date
  14-Apr-19
  14-Apr-19
  14-Apr-19
  14-Apr-19
  </code></pre>