pandas.qcut: Bin a DataFrame’s Values into Equal-Sized Intervals

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. 

My previous tips on pandas.

Scroll to Top