We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cc1c406 commit 0cbeae5Copy full SHA for 0cbeae5
pandas/core/reshape/tile.py
@@ -345,6 +345,18 @@ def qcut(
345
else:
346
quantiles = q
347
bins = algos.quantile(x, quantiles)
348
+
349
+ # Added code
350
+ # ------------------------------
351
+ unique_bins = set(bins)
352
353
+ for i, b in enumerate(bins):
354
+ if(b in unique_bins):
355
+ unique_bins.remove(b)
356
+ else:
357
+ bins[i] = np.nextafter(x[x>bins[i]].min(), bins[i])
358
359
360
fac, bins = _bins_to_cuts(
361
x,
362
bins,
0 commit comments