From 1415d3d2731bd0a1f35054846c598b7f3a839115 Mon Sep 17 00:00:00 2001 From: cayetanobv Date: Fri, 17 Jan 2025 14:47:19 +0100 Subject: [PATCH] fix: most_common_approx duplicated counts definition --- raster_loader/io/common.py | 1 - 1 file changed, 1 deletion(-) diff --git a/raster_loader/io/common.py b/raster_loader/io/common.py index 814f5bd..60f60f3 100644 --- a/raster_loader/io/common.py +++ b/raster_loader/io/common.py @@ -492,7 +492,6 @@ def most_common_approx(samples: List[Union[int, float]]) -> Dict[int, int]: counts, bin_edges = np.histogram(samples_array, bins=bins) nth = min(DEFAULT_MAX_MOST_COMMON, len(counts)) - counts = np.bincount(samples) idx = np.argpartition(counts, -nth)[-nth:] return {int(bin_edges[i]): int(counts[i]) for i in idx if counts[i] > 0}