title: Using a variable to query or filter on a dataset in python
body: <p>I'm using pandas on a project using a dataset that has 21 columns and almost 11,000 rows.</p>
  
  <p>I created a new variable titled <code>name_ten_plus</code> that shows the count for column <code>name</code> filtered to be greater or equal to ten, using the following code:</p>
  
  <pre><code>name_ten_plus = df_name_data['name'].value_counts()[df_name_data['name'].value_counts() &gt;= 10]
  </code></pre>
  
  <p>Using <code>print(name_ten_plus)</code>, it shows there are 120 <code>name</code> values that occur at least ten times.  The print function yields (as an example): </p>
  
  <pre><code>Mike M     22
  John J     22
  Mark K     21
  etc...(stacked under each other)
  </code></pre>
  
  <p>What I've been stuck on is trying to figure out a way to create a subset 
  of the original dataset that contains only the rows for the names in <code>name_ten_plus</code>.  </p>
  
  <p>I have researched how to perform this task in a few different fashions, from using query to the lambda function, and I tried groupby as well.  </p>
  
  <p>I cannot find an example that pertains to my exact situation.</p>
  
  <p>Any help will be greatly appreciated.  I'll keep cranking away in the meantime.</p>
  
  <p>Note: I am new to programming, so I apologize for any misphrased language.  This is my first post in this community, but thanks to all previous posters and responders for the assistance and insight provided in these forums.</p>
  
  <p>Mike M </p>