Skip to content

Commit

Permalink
fix: most_common_approx duplicated counts definition (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
cayetanobv authored Jan 17, 2025
1 parent fc45f68 commit 2f641e9
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion raster_loader/io/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 2f641e9

Please sign in to comment.