8000 DOC: Improve np.histogram documentation by TheHawz · Pull Request #25403 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

DOC: Improve np.histogram documentation #25403

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

TheHawz
Copy link
Contributor
@TheHawz TheHawz commented Dec 16, 2023

Improving np.histogram's documentation

It was not documented that the dtype of the output of np.histogram's depends on the dtype of the weights parameter.

Closes #25385
Closes #23681
Closes #16616

Skipping all CI because this is a documentation correction:
[skip ci]

It must be ``text``and not `text` for inline code samples.
@TheHawz TheHawz closed this Dec 16, 2023
@TheHawz TheHawz deleted the improve-histogram-documentation branch December 16, 2023 16:09
@hmeine
Copy link
Contributor
hmeine commented Dec 19, 2023

Thanks! I just want to note, however, that it is not unambiguous that "dictates the dtype" means that the accumulator dtype will become exactly the dtype of the weights – it could also mean that there is a mapping such as weights uint8 -> acc uint64, weights float -> acc double, ... that would be applied. (And that would make so much sense that people could expect that and thus read it into the new documentation sentence, I am afraid.)

@rossbar
Copy link
Contributor
rossbar commented Dec 19, 2023

@hmeine that sounds reasonable - please feel free to propose wording updates in a PR!

rossbar pushed a commit that referenced this pull request Jan 17, 2024
* DOC: unambiguous np.histogram dtype description

As a follow-up of #25403, let's be more specific than "dictates the
dtype" because that could still mean that there is a mapping applied
such as weights uint8 -> acc uint64, weights float -> acc double, ...

That would make so much sense that people could expect that and thus
read it into the documentation, I am afraid.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
0