-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
DOC: Added sentence to docstring of histogram_bin_edges to explain bin width #18344
DOC: Added sentence to docstring of histogram_bin_edges to explain bin width #18344
Conversation
I think the build failure is unrelated, builds fine locally. |
Yeah, we are seeing that a lot just now:
I opened gh-18349, from the docs it sounds like that should fix it (https://support.circleci.com/hc/en-us/articles/360007188574-Build-has-hit-timeout-limit) |
numpy/lib/histograms.py
Outdated
@@ -562,7 +562,9 @@ def histogram_bin_edges(a, bins=10, range=None, weights=None): | |||
below, :math:`h` is the binwidth and :math:`n_h` is the number of | |||
bins. All estimators that compute bin counts are recast to bin width | |||
using the `ptp` of the data. The final bin count is obtained from | |||
``np.round(np.ceil(range / h))``. | |||
``np.round(np.ceil(range / h))``. The final bin width is often less | |||
than what is returned by the formulas below, in order to allow the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: "The final bin width will therefore generally be less than what is returned by the estimators." "estimator" is a better term than formula, and more consistent. The part about entire range is covered by ptp
two sentences back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your comment, will adjust and repush
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a good change. Hopefully it gets included soon.
Thanks, @jamiebarker0310 ! |
This regards #18319 where it was discussed that the width of the bins returned is not equal to what would is described by the formulas described in the "bins" parameter.