📜  cut 和 qcut pandas 之间的区别 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:24.439000             🧑  作者: Mango

代码示例5
\
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