8000 DOC: unambiguous np.histogram dtype description by hmeine · Pull Request #25520 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

DOC: unambiguous np.histogram dtype description #25520

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

Merged
merged 2 commits into from
Jan 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions numpy/lib/_histograms_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,9 @@ def histogram(a, bins=10, range=None, density=None, weights=None):
(instead of 1). If `density` is True, the weights are
normalized, so that the integral of the density over the range
remains 1.
Please note that the ``dtype`` of `weights` will dictate the
``dtype`` of the returned accumulator (`hist`).
Please note that the ``dtype`` of `weights` will also become the
``dtype`` of the returned accumulator (`hist`), so it must be
large enough to hold accumulated values as well.
density : bool, optional
If ``False``, the result will contain the number of samples in
each bin. If ``True``, the result is the value of the
Expand All @@ -725,7 +726,8 @@ def histogram(a, bins=10, range=None, density=None, weights=None):
-------
hist : array
The values of the histogram. See `density` and `weights` for a
description of the possible semantics.
description of the possible semantics. If `weights` are given,
``hist.dtype`` will be taken from `weights`.
bin_edges : array of dtype float
Return the bin edges ``(length(hist)+1)``.

Expand Down
0