title: How to get specific number of rows based on column values in dataframe
body: <p>Suppose I have a MNIST dataset in this way. </p>
  
  <pre><code>df = pd.read_csv('data/train.csv')
  data = df.loc[df['label'].isin([1,6])]
  </code></pre>
  
  <p>I am trying to select only those rows whose column ['label'] == 1 or 6. </p>
  
  <p>But, I am want to get only 500 rows from each column ['label']</p>
  
  <p>How do I do it?</p>