-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Expose histogram bin estimators? #10183
Comments
Is the application here:
That seems like a pretty reasonable application to me. I'm not sure if we should directly expose those functions, or just expose a |
I'm not sure how we can expose the uniform range optimization in that use case, but I suppose optimality is not the primary concern. |
It's waiting on #10186, but I have a local patch that exposes Does that sound like a reasonable API? |
I think the application is computing bins for |
I like the separate |
Alright, as of #10261 this is now trivial to patch on master in def histogram_bin_edges(a, bins=10, range=None, weights=None):
a, weights = _ravel_and_check_weights(a, weights)
bin_edges, _ = _histogram_bins(a, bins, range, weights)
return bin_edges Most of the work here is to add a docstring, and some simple tests - so tagging as an easy fix I suppose emailing the mailing list to confirm the function name could be valuable too. |
Does this issue still need to be worked on? If so, I'd like to work on this! |
@kirit93: Go for it! |
@eric-wieser Have you added this function to master?
There's no function Shouldn't the function be
I just need to add this function to Thanks! |
@dstansby: This will be in 1.15 - although matplotlib's minimum numpy version is currently 8 minor versions behind that, so you could be waiting a long time! I suppose you could backport the |
Would it be possible to expose the histogram bin estimators available in numpy? e.g.
numpy/numpy/lib/function_base.py
Line 393 in e94ed84
We would find it useful in Matplotlib for computing bins without having to spend time computing the full histogram (xref matplotlib/matplotlib#8636)
The text was updated successfully, but these errors were encountered: