title: Getting data from CSV for a specific date and time in python
body: <p>I have written a python program which gets csv data for a specific date in python. I want to also get the data for a specific time like for 2 hours on a specific date. But the problem is that in my csv file, date and time are stored in different columns (col 2 for time).I also want to plot the data for this on a graph. heres my code: </p>
  
  <pre><code> from_raw = self.userInputFromRaw.get()
      from_date = datetime.date(*map(int, from_raw.split('/')))
      print ('From date: = ' + str(from_date))
      to_raw = self.userInputToRaw.get()
      to_date = datetime.date(*map(int, to_raw.split('/')))
      in_file = 'C:\\Users\Lala Rushan\Downloads\ARIF Drop Monitoring Final\ARIF Drop Monitoring Final\DataLog.CSV'
      in_file= csv.reader(open(in_file,"r"))
  
      for line in in_file:
          _dist = line[0]
          try:
              file_date =  datetime.date(*map(int, line[1].split(' ')[1].split('/')))
              if from_date &lt;= file_date &lt;= to_date:
                  self.CsvImport(in_file)
  
          except IndexError:
              pass
  </code></pre>
  
  <p>Can anyone tell me how can i get data for a specific time interval on a specific date (taken by the user) and plot it on a graph? I dont know how can i extract for BOTH date and time simultaneously. </p>
  
  <p>my Csv file looks like this: </p>
  
  <pre><code>2    2017/02/17  23:02:31.615
  1    2017/02/17  23:02:36.611
  1    2017/02/17  23:02:41.601
  2    2017/02/17  23:02:46.748
  2    2017/02/17  23:02:51.620
  2    2017/02/17  23:02:56.627
  1    2017/02/17  23:03:01.617
  2    2017/02/17  23:03:06.646
  2    2017/02/17  23:03:11.643
  </code></pre>