title: Pandas pivot_table group column by values
body: <p>I am trying to use numeric values as columns on a Pandas pivot_table. The problem is that since each number is mostly unique, the resulting pivot_table isn't very useful as a way to aggregate my data. </p>
  
  <p>Here is what I have so far (fake data example):</p>
  
  <pre><code>import pandas as pd   
  
  df = pd.DataFrame({'Country': ['US', 'Brazil', 'France', 'Germany'], 
                         'Continent': ['Americas', 'Americas', 'Europe', 'Europe'], 
                         'Population': [321, 207, 80, 66]})
  
  
  pd.pivot_table(df, index='Continent', columns='Population', aggfunc='count')
  </code></pre>
  
  <p>Here is an image of the resulting 
  <img src="https://i.stack.imgur.com/lfBSk.jpg" alt="pivot_table">.</p>
  
  <p>How could I group my values into ranges based on my columns? </p>
  
  <p>In other words, how can I count all countries with Population... &lt;100, 100-200, >300?</p>