If you want to bin a column’s values into intervals that contain roughly the same number of elements, use pandas.qcut.
In the example below, the values of “a” are separated into 3 intervals, each of which contains 2 elements.
If you want to bin a column’s values into intervals that contain roughly the same number of elements, use pandas.qcut.
In the example below, the values of “a” are separated into 3 intervals, each of which contains 2 elements.