Examples
import numpy as np import pandas as pd
pd.qcut(range(4), 5) ... # doctest: +ELLIPSIS
[(-0.001, 0.6], (0.6, 1.2], (1.8, 2.4], (2.4, 3.0]] Categories (5, interval[float64]): [(-0.001, 0.6] < (0.6, 1.2] < (1.2, 1.8] < (1.8, 2.4] < (2.4, 3.0]]
pd.qcut(range(4), 3, labels=["large", "big", "small"]) # doctest: +SKIP
[large, large, big, small] Categories (3, object): [large < big < small]
pd.qcut(range(6), 5, labels=False)
array([0, 0, 1, 2, 3, 4], dtype=int64)