title: I have a problem with a for. How can I loop through the for and add the data to a list?
body: <p>I have this dataframe (compressed):</p>
  <pre><code>year    month      name
  
  2000    January    car
  2000    January    bike
  2000    February   train
  2000    May        car
  2001    January    bike
  2001    February   car
  2001    February   bike
  2001    July       car
  2002    January    car
  2002    February   train
  2002    March      bike
  2002    July       car
  </code></pre>
  <p>I need to add the data for 2001 and February to a list, for this I have made the following code.</p>
  <pre><code>name2001 = []
  for year in df['year']:
      if year == 2001:
          for month in df['month']:
              if month == 'February':
                  for name in df['name']:
                      name2001.append(name)
  </code></pre>
  <p>I was debugging and I got this error:</p>
  <pre><code>'Too large to show contents. Max items to show: 300'
  </code></pre>
  <p>I changed it to 10000 and I get this error:</p>
  <pre><code>'Too large to show contents. Max items to show: 10000'
  </code></pre>
  <p>But I know that approximately 5000 data must be added.</p>
  <p>What is wrong with the for-loop?</p>