[Numpy-discussion] indexed assignment testcases

2014-07-06 Thread Benjamin Root
While trying to wrap my head around the issues with matplotlib's tri module and the new numpy indexing, I have made some test cases where I wonder if warnings should be issued. import numpy as np a = np.ones((10,)) all_false = np.zeros((10,), dtype=bool) a[all_false] = np.array([2.0]) # the

Re: [Numpy-discussion] indexed assignment testcases

2014-07-06 Thread Sebastian Berg
On So, 2014-07-06 at 15:32 -0400, Benjamin Root wrote: While trying to wrap my head around the issues with matplotlib's tri module and the new numpy indexing, I have made some test cases where I wonder if warnings should be issued. import numpy as np a = np.ones((10,)) all_false =

Re: [Numpy-discussion] indexed assignment testcases

2014-07-06 Thread Charles R Harris
On Sun, Jul 6, 2014 at 1:32 PM, Benjamin Root ben.r...@ou.edu wrote: While trying to wrap my head around the issues with matplotlib's tri module and the new numpy indexing, I have made some test cases where I wonder if warnings should be issued. import numpy as np a = np.ones((10,))

Re: [Numpy-discussion] indexed assignment testcases

2014-07-06 Thread Benjamin Root
re: deprecation warnings... that's what I get when I am working on my non-dev box because I am at the conference, and have gotten too used to the setup of my dev box... as for the broadcasting issue, I can see it for the second case, but the first case still doesn't sit right with me. My

Re: [Numpy-discussion] indexed assignment testcases

2014-07-06 Thread Sebastian Berg
On So, 2014-07-06 at 16:14 -0400, Benjamin Root wrote: re: deprecation warnings... that's what I get when I am working on my non-dev box because I am at the conference, and have gotten too used to the setup of my dev box... as for the broadcasting issue, I can see it for the second case,

Re: [Numpy-discussion] indexed assignment testcases

2014-07-06 Thread Nathaniel Smith
On Sun, Jul 6, 2014 at 9:14 PM, Benjamin Root ben.r...@ou.edu wrote: as for the broadcasting issue, I can see it for the second case, but the first case still doesn't sit right with me. My understanding of broadcasting is to effectively *expand* an array to match the shape of another array (or

Re: [Numpy-discussion] indexed assignment testcases

2014-07-06 Thread Benjamin Root
I guess I always treated scalars as something special when it comes to broadcasting. Seeing these examples, I can see how my grokking of broadcasting was incomplete. I still think that the assignment of an array of values (as opposed to a scalar) to nothing could potentially mask deeper issues,