[Numpy-discussion] 1.10.0rc1

Sebastian Berg sebastian at sipsolutions.net
Thu Aug 27 10:44:34 EDT 2015


On Do, 2015-08-27 at 08:04 -0600, Charles R Harris wrote:
> 
> 
> On Thu, Aug 27, 2015 at 7:52 AM, Benjamin Root <ben.v.root at gmail.com>
> wrote:
>         
>         
>         Ok, I tested matplotlib master against numpy master, and there
>         were no errors. I did get a bunch of new deprecation warnings
>         though such as:
>         
>         "/nas/home/broot/centos6/lib/python2.7/site-packages/matplotlib-1.5.dev1-py2.7-linux-x86_64.egg/matplotlib/colorbar.py:539: VisibleDeprecationWarning: boolean index did not match indexed array along dimension 0; dimension is 5 but corresponding boolean dimension is 3
>           colors = np.asarray(colors)[igood]"
>         
>         
>         The message isn't exactly clear. I suspect the problem is a
>         shape mismatch, like colors is 5x3, and igood is just 3 for
>         some reason. Could somebody shine some light on this, please?
>         
> 
> 
> IIRC, Boolean indexing would fill out the dimension, i.e., len 3 would
> be expanded to len 5 in this case. That behavior is deprecated.
> 

Yes, this is exactly the case, you have something like:

arr = np.zeros((5, 3))
ind = np.array([True, False, False])
arr[ind, :]

and numpy nowadays thinks that such code is likely a bug (when the ind
is shorter than arr it is somewhat OK, the other way around gets more
creepy). If you have an idea of how to make the error message clearer,
or objections to the change, I am happy to hear it!

- Sebastian


> 
> Chuck
> 
> 
> 
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20150827/205c52f3/attachment.sig>


More information about the NumPy-Discussion mailing list