From 31a0d1bbb5cf5dd14490573c3ddfbabdaf527249 Mon Sep 17 00:00:00 2001 From: mbsantiago Date: Mon, 11 Aug 2025 08:59:12 +0100 Subject: [PATCH] Drop duplicate bin edges --- src/batdetect2/plotting/evaluation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/batdetect2/plotting/evaluation.py b/src/batdetect2/plotting/evaluation.py index 2437821..b6775d3 100644 --- a/src/batdetect2/plotting/evaluation.py +++ b/src/batdetect2/plotting/evaluation.py @@ -154,7 +154,7 @@ def get_binned_sample(matches: List[MatchEvaluation], n_examples: int = 5): ] ) - bins = pd.qcut(pred_scores, q=n_examples, labels=False) + bins = pd.qcut(pred_scores, q=n_examples, labels=False, duplicates="drop") df = pd.DataFrame({"indices": indices, "bins": bins}) sample = df.groupby("bins").apply(lambda x: x.sample(1)) return [matches[ind] for ind in sample["indices"]]