title: Find (only) the first row satisfying a given condition in pandas DataFrame
body: <p>I have a dataframe <code>df</code> with a very long column of random positive integers:</p>
  
  <pre><code>df = pd.DataFrame({'n': np.random.randint(1, 10, size = 10000)})
  </code></pre>
  
  <p>I want to determine the index of the <em>first</em> even number in the column. One way to do this is:</p>
  
  <pre><code>df[df.n % 2 == 0].iloc[0]
  </code></pre>
  
  <p>but this involves a lot of operations (generate the indices <code>f.n % 2 == 0</code>, evaluate <code>df</code> on those indices and finally take the first item) and is very slow. A loop like this is much quicker:</p>
  
  <pre><code>for j in range(len(df)):
      if df.n.iloc[j] % 2 == 0:
          break
  </code></pre>
  
  <p>also because the first result will be probably in the first few lines.  Is there any pandas method for doing this with similar performance? Thank you.</p>
  
  <p><strong>NOTE:</strong> This condition (to be an even number) is just an example.  <strong>I'm looking for a solution that works for any kind of condition on the values, i.e., for a fast one-line alternative to:</strong></p>
  
  <pre><code>df[ conditions on df.n ].iloc[0]
  </code></pre>