title: Python pandas: filtering rows based on time criteria using pandas
body: <p>I have a CSV file with millions of rows in the following format:</p>
  
  <pre><code>Amount,Price,Time
  0.36,13924.98,2010-01-01 00:00:08
  0.01,13900.09,2010-01-01 00:02:04
  0.02,13907.59,2010-01-01 00:04:54
  0.07,13907.59,2010-01-01 00:05:03
  0.03,13925,2010-01-01 00:05:41
  0.03,13920,2010-01-01 00:07:02
  0.15,13910,2010-01-01 00:09:37
  0.03,13909.99,2010-01-01 00:09:58
  0.03,13909.99,2010-01-01 00:10:03
  0.14,13909.99,2010-01-01 00:10:03
  </code></pre>
  
  <p>I want to first filer this data and then perform some calculation on the filtered data. I import it using pandas <code>data = pd.read_csv()</code>, to get a DataFrame.</p>
  
  <p>I then transform the <code>Time</code> column to <code>TimeDelta</code> column (which I am not sure is necessary for what I want to do) where I write the time difference to the time <code>2010-01-01 00:00:00</code> by using</p>
  
  <pre><code>data['TimeDelta'] = pd.to_timedelta(pd.to_datetime(data.Date)-pd.Timedelta(days=14610))/np.timedelta64(1, 'm')
  </code></pre>
  
  <p>Here comes the part that I struggle with. I want a function that returns a new DataFrame, where I want only the first row after every <code>n</code> minutes, where <code>n</code> is an integer defined by the user.</p>
  
  <p>For example. If <code>n=5</code>, the desired output of this function for my data would be:</p>
  
  <pre><code>Amount,Price,Time
  0.36,13924.98,2010-01-01 00:00:08
  0.07,13907.59,2010-01-01 00:05:03
  0.03,13909.99,2010-01-01 00:10:03
  </code></pre>
  
  <p>And the output for <code>n=3</code> would be:</p>
  
  <pre><code>Amount,Price,Time
  0.36,13924.98,2010-01-01 00:00:08
  0.02,13907.59,2010-01-01 00:04:54
  0.15,13910,2010-01-01 00:09:37
  </code></pre>
  
  <p>I have tried doing this using the <code>floor</code> and the remainder <code>%</code>, but being a beginner with Python I am unable to get it working. </p>