Previous questions about this warning:
VisibleDeprecationWarning: boolean index does not match an indexed array of size 1; the dimension is 2, but the corresponding Boolean dimension is 1
fooobar.com/questions/1001784 / ...
I think this is something new in numpy 1.10 and is the result of using a logical index that is shorter than an array. I do not have an installed version, so I can not give an example. But in earlier numpy
In [667]: x=np.arange(10) In [668]: ind=np.array([1,0,0,1],bool) In [669]: ind Out[669]: array([ True, False, False, True], dtype=bool) In [670]: x[ind] Out[670]: array([0, 3])
works fine even though ind shorter than x . It efficiently pads ind using False . I think new versions continue to do the calculations, but they give this warning. I need to find a commit that changed this question or an SO question that discusses it.
You can suppress warnings - see the sidebar. But you really have to check the shape of the offending arrays. Do they match, or is the Boolean index too? Can you fix it?
Github talk
https://github.com/numpy/numpy/issues/4980 Boolean array indexing fails # 4980
Request Request
https://github.com/numpy/numpy/pull/4353 DEP: obsolete logical array indices with inconsistent form # 4353
To suppress a warning, use something like:
import warnings warnings.filterwarnings("ignore", category=np.VisibleDeprecationWarning)
you may need to adjust the category name to be correct.