Skip to content

Instantly share code, notes, and snippets.

@skillachie
Created March 19, 2015 01:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skillachie/be1d6f55fb4b6e23e97a to your computer and use it in GitHub Desktop.
Save skillachie/be1d6f55fb4b6e23e97a to your computer and use it in GitHub Desktop.
qcut error
import pandas as pd
unique = [1,2,3,4,5,6,7,8,9,10,11,12,13,51,52,55]
df1= pd.qcut(unique,10,[1,2,3,4,5,6,7,8,9,10])
print df1
print 'works'
# represents cases when we simply have 0/na for some deciles
# Need to fix
non_unique = results = [1,1,1,1,1,1,1,1,1,1,1,1,1,5,5,5]
df2= pd.qcut(non_unique,10,[1,2,3,4,5,6,7,8,9,10])
print df2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment