title: Filter in pandas a DataFrame where a column value has been repeated exactly a certain number of cases
body: <p>For example if I have a DataFrame of people_ids and their dogs, where if a person has two dogs it appears twice, each with a different dog, and I want to find exactly the people who have two or three dogs.</p>
  <p>I would use some code like:</p>
  <pre><code>df[df.col.isin(df.col.value_counts()[df.col.value_counts()==2].index)]
  </code></pre>
  <p>however this seems awfully convoluted, i have to reference the DataFrame four times and run the value_counts function twice.</p>
  <p>Any ideas that might help this be a bit more simple and straightforward?
  Thanks</p>