title: How to use pandas.qcut to make deciles out of values in a column
body: <p>I am currently trying to manipulate some data into 10 quantiles.</p>
  
  <p>The dataframe I have loaded has a column A, B, and C</p>
  
  <p>My current code can break them into 10 equal size groups but what I am trying to achieve is based off of the actual number within the rows. So I want to break it into 10 deciles of equal sum of the value in column C. This will certainly mean that the deciles will have a different amount of entries per bucket. Is this possible through pd.qcut? Can anyone point me in the right direction?</p>
  
  <p>Current code is as follows:</p>
  
  <pre><code>user_df['decile'] = pd.qcut(user_df['C'].rank(method='first').values, 10, duplicates='drop').codes + 1 
  user_df.groupby('decile')
  </code></pre>
  
  <p>How can I sort by the actual values in column C?</p>
  
  <p>Thanks!</p>