from physt import h2
from scipy.stats import multivariate_normal
hist = h2(*multivariate_normal.rvs((0,0), size=100_000).T, bins=100)
hist.merge_bins(2)
You get a warning from numpy:
/home/schreihf/.local/lib/python3.7/site-packages/physt/histogram_base.py:572: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
new_frequencies[new_index] += old_frequencies[old_index]
/home/schreihf/.local/lib/python3.7/site-packages/physt/histogram_base.py:573: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
new_errors2[new_index] += old_errors2[old_index]
If you try to merge bins:
You get a warning from numpy: