You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
hexbin passes empty bins to reduce_C_function when mincnt is 0 or None #32077
Empty bins are passed to the C reducer when mincnt is zero or None. This causes reducers such as np.sum to produce spurious zero-valued bins, while custom reducers may raise an exception.
This is a regression introduced by PR #26113: #26113
The bin-inclusion condition was changed from count > mincnt to count >= mincnt. Consequently, zero-count bins are processed when mincnt is 0. When C is provided and mincnt is None, it is internally set to 0, producing the same behavior. Reducers such as np.sum return spurious zero-valued bins for empty inputs, while custom reducers may raise an exception.
If someone passes a reducer that explicitly does not allow zero-sized arrays, then I think it is up to them to also pass a consistent mincnt. If someone passess mincnt of zero with np.sum, they are presumably happy to have zero-totals in their plot. I am unclear what the bug is here.
Activity
rcomer commentedon Jul 20, 2026
If someone passes a reducer that explicitly does not allow zero-sized arrays, then I think it is up to them to also pass a consistent mincnt. If someone passess mincnt of zero with
np.sum, they are presumably happy to have zero-totals in their plot. I am unclear what the bug is here.rcomer commentedon Jul 20, 2026
This was changed to 1 at #27179.
rcomer commentedon Aug 8, 2026
Closing this one as I do not think there is a bug here.