Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

difference between cut and qcut pandas


df['quantile_ex_4'] = pd.qcut(df['ext price'],
                            q=[0, .2, .4, .6, .8, 1],  #quartiles bin range will vary
                            labels=False,     #returns integers as categories
                            precision=0)
df.head()
#all bins will have roughly same no. of observation
Source by pbpython.com #
 
PREVIOUS NEXT
Tagged: #difference #cut #qcut #pandas
ADD COMMENT
Topic
Name
4+2 =