title: Creating new column by looping through another column...not working
body: <p>I'm trying to create a new "category" based on the value in another column (looping through that column).  Here is my code.</p>
  
  <pre><code>def minority_category(minority_col):
  for i in minority_col:
      if i &lt;= 25:
          return '&lt;= 25%'
      if i &gt; 25 and i &lt;= 50:
          return '&lt;= 50%'
      if i &gt; 50 and i &lt;= 75:
          return '&lt;= 75%'
      if i &gt; 75 and i &lt;= 100:
          return '&lt;= 100%'
      return 'Unknown'
  </code></pre>
  
  <p>However, the result is '&lt;=75%' in the entire new column.  Based on examples I've seen, my code looks right.  Can anyone point out something wrong with the code?  Thank you.</p>