xhistogram
xhistogram copied to clipboard
Fast, flexible, label-aware histograms for numpy and xarray
We've had a couple of bug fixes recently (#12, #78). Shall we do a release?
Is it possible to easily extend the functionality to include the histogram of the weights for a particular bin? The current weights options gives a sum, but sometimes it would...
``` from xhistogram.core import histogram data = np.zeros(36048471) bins = np.array([1, 2, 3]) histogram(data, bins=[bins]) ``` gives ``` --------------------------------------------------------------------------- ZeroDivisionError Traceback (most recent call last) in 3 data = np.zeros(36048471)...
This is based on a brilliant suggestion by @dcherian, which I have used in multiple projects. I think it would be very nice to document this little 'trick' to efficiently...
I mentioned this over in #73, but it might be worth raising a separate issue here. It seems that there is a flaky test in the CI suite. See these...
I would find it very useful to preserve the input `bins` as [CF bound coordinates](http://cfconventions.org/cf-conventions/cf-conventions.html#cell-boundaries) in the output. I can try to put in a PR some time soon if...
Thanks to you guys for this handy package. I had to use time-varying bins when I tried to calculate the area enclosed by tracer contours, as the tracer changes with...
I tried profiling the core `_bincount` function, and then accelerating it with numba, a naive application of which only made it about 30% faster overall. [Notebook here](https://nbviewer.jupyter.org/gist/TomNicholas/5e92acb9b118163be058c74da73d761b?flush_cache=true) (and [gist here](https://gist.github.com/TomNicholas/5e92acb9b118163be058c74da73d761b)...
Work-in-progress attempt to implement #28 . Builds atop #49. - Allows bins to be xr.DataArrays - Aligns and reshapes the bins the same way as the other arrays - Promotes...
After @shoyer mentioned earlier today that he had [an example](https://nbviewer.jupyter.org/gist/shoyer/6d6c82bbf383fb717cc8631869678737) of dealing with with the ND-histogram problem in xarray by using `xarray.apply_ufunc` and [numpy_groupies](https://github.com/ml31415/numpy-groupies), I made [this notebook](https://nbviewer.jupyter.org/gist/TomNicholas/1965788fdd499bf02c5331f2e59e27b4) to try...