>>> pd.qcut(range(5), 3, labels=["good", "medium", "bad"]) ... [good, good, medium, bad, bad] Categories (3, object): [good < medium < bad]