janpipek / physt

Python histogram library - histograms as updateable, fully semantic objects with visualization tools. [P]ython [HYST]ograms.
MIT License
131 stars 14 forks source link

Warning in current numpy #49

Closed henryiii closed 5 years ago

henryiii commented 5 years ago

If you try to merge bins:

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]
janpipek commented 5 years ago

Hi. Thanks for reporting. I will try to fix this asap.

janpipek commented 5 years ago

Solved, hopefully in all other occurrences as well.