title: Test if a value occurs in a Pandas column
body: <p>One way to test if a value occurs in a column in a Pandas data frame is to count the occurrences of each value, so for example if we want to check for the occurrence of 'dog' in the column 'pet' we could do this</p>
  <pre class="lang-python prettyprint-override"><code>at_least_one_dog = df['pet'].value_counts()['dog'] &gt; 0
  </code></pre>
  <p>or we could check that it is in the list of all the values in the column like this</p>
  <pre class="lang-python prettyprint-override"><code>at_least_one_dog = 'dog' in df['pet'].unique()
  </code></pre>
  <p>But both of these methods process the entire column before producing an answer, which can be time consuming for a very large data frame. Is there a way to test for the occurrence of a value in a column that returns <code>True</code> immediately the first occurrence is encountered without necessarily going through the whole column?</p>