title: Pandas how to group data into ranges?
body: <p>I have numeric data in a column from each value is from 1-28.</p>
  
  <p>I need to do a value count and a percentage by splitting it into two categories 1-21, and 22-28. </p>
  
  <p>I need something like:</p>
  
  <pre><code>Category   cout  percentage 
  1-21       xxx      xxx%
  22-28      xxx      xxx%
  </code></pre>
  
  <p>How can I do this in pandas? </p>
  
  <p>I've tried may different things from cut and groupby but I can't seem to figure it out.</p>
  
  <p>Thank you for your help and time. </p>