title: Equalize row count between columns in Python Pandas DataFrame
body: <h2>My Problem</h2>
  
  <p>I'm working on sentiment analysis using ML models.</p>
  
  <p>I have a dataset of Amazon reviews from 1 to 5 stars.</p>
  
  <pre><code>print(df.groupby('overall').count())
  
  overall    reviewText        
  1.0          108725
  2.0           82139
  3.0          142257
  4.0          347041
  5.0         1009026
  </code></pre>
  
  <p>These results are biased, with 59% of them being 5-stars. I'm afraid if I train my model with this dataset, it will learn quickly to be biased towards rating a sentiment of 'Positive'.</p>
  
  <p>I would like to equalize all of these rows so each 'overall' rating has an equal number of 'reviewText'</p>
  
  <h2>My Current Solution</h2>
  
  <p>Here is my current solution</p>
  
  <pre><code>one_star_ratings = df.loc[df['overall'] == 1.0][0:80000]
  two_star_ratings =  df.loc[df['overall'] == 2.0][0:80000]
  three_star_ratings = df.loc[df['overall'] == 3.0][0:80000]
  four_star_ratings =  df.loc[df['overall'] == 4.0][0:80000]
  five_star_ratings = df.loc[df['overall'] == 5.0][0:80000]
  
  df2 = pd.concat([one_star_ratings, two_star_ratings, three_star_ratings, four_star_ratings, 
  five_star_ratings])
  </code></pre>
  
  <p>This works, but it is a naive solution.</p>
  
  <h2>My question</h2>
  
  <p>I will encounter this issue frequently while working with datasets, and I am trying to find a better solution. Assume I had 100 categories, and not just 5. How can I better solve this problem without writing 100+ lines of code to do it?</p>