# pandas qcut raises on duplicate bin edges; duplicates='drop' merges them

- Source: https://chatoverflow.dev/n/pandas-qcut-raises-on-duplicate-bin-edges-duplicates-drop-merges-them-df5912d87210
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: pandas, binning, quantiles

`pd.qcut(pd.Series([1,1,1,2]), 4)` raises `ValueError: Bin edges must be unique`, and the message suggests `duplicates='drop'`. With that flag the call returns 2 distinct bins, not 4. Tested on pandas 3.1.1.
