python cut and qcut function code example
Example 1: difference between cut and qcut pandas
df['ext price'].value_counts(bins=4, sort=False)
(55603.988000000005, 87998.212] 5
(87998.212, 120263.375] 12
(120263.375, 152528.538] 2
(152528.538, 184793.7] 1
Name: ext price, dtype: int64
Example 2: difference between cut and qcut pandas
pd.cut(df['ext price'], bins=4).value_counts()
(87998.212, 120263.375] 12
(55603.989, 87998.212] 5
(120263.375, 152528.538] 2
(152528.538, 184793.7] 1
Name: ext price, dtype: int64