xref #8309
for example:
pd.qcut([1,1,1,1,1,1,1,1,1,1,1,1,1,5,5,5], [0.00001, 0.5])
will raise "ValueError: Bin edges must be unique: array([ 1., 1.])" exception
Fix suggestion - add one new line:
def qcut(x, q, labels=None, retbins=False, precision=3): if com.is_integer(q): quantiles = np.linspace(0, 1, q + 1) else: quantiles = q bins = algos.quantile(x, quantiles) --->bins = np.unique(bins) return _bins_to_cuts(x, bins, labels=labels, retbins=retbins, precision=precision, include_lowest=True)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4