function binned statistics from scipy.stats raise warning:
/usr/local/lib/python3.5/dist-packages/scipy/stats/_binned_statistic.py:607: 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.
result = result[core]
to reproduce just run stats.binned_statistics documentation example:
values = [1.0, 1.0, 2.0, 1.5, 3.0]
st.binned_statistic([1, 1, 2, 5, 7], values, 'sum', bins=2)
I tried to foollow the warning by:
values = np.array((1.0, 1.0, 2.0, 1.5, 3.0))
st.binned_statistic(np.array((1, 1, 2, 5, 7)), values, 'sum', bins=2)
But it seems no results. How to ommit this message without global filtering future warning
scipy 1.1.0 numpy 1.15.0 python 3.5, ubuntu 16.04