Skip to content

ENH: handle masked arrays on histogram.#31491

Open
JosephMehdiyev wants to merge 2 commits into
numpy:mainfrom
JosephMehdiyev:hist-mask
Open

ENH: handle masked arrays on histogram.#31491
JosephMehdiyev wants to merge 2 commits into
numpy:mainfrom
JosephMehdiyev:hist-mask

Conversation

@JosephMehdiyev

@JosephMehdiyev JosephMehdiyev commented May 23, 2026

Copy link
Copy Markdown
Contributor

Add logic to handle masked data and masked weights on histogram.
fixes #10019

PR summary

This PR makes weights and the input data to be possibly passed with masked arrays.
If both the weights and input are masked, it will combine the masked data as I feel like this is more natural. It will not raise errors if masks are not matched.

Other comments

note that this PR does not add masked support for histogramdd. I will open other PRs for it (hopefully).

AI Disclosure

the lines 297-302 was generated by Claude (because of lazyness)
tests were partially written by claude
Claude was also used to review the code

Add logic to handle masked data and masked weights on histogram.
@JosephMehdiyev

Copy link
Copy Markdown
Contributor Author

hmmmm, something is very wrong about CI

@JosephMehdiyev JosephMehdiyev marked this pull request as draft May 23, 2026 22:09
@JosephMehdiyev JosephMehdiyev marked this pull request as ready for review May 23, 2026 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

histogram doesn't always work with masked arrays

1 participant