[Numpy-discussion] variable end border in arrays

2015-06-05 Thread Pablo
Hi, If I want to remove 1 element in the beginning and the end of a numpy array x we do: x[1:-1] Now, if we have a border variable, and borders are allowed to be zero (which means no border), numpy syntax is inconvenient. For example if border=numpy.asarray([1,0]) and we try

Re: [Numpy-discussion] DEP: Deprecate boolean array indices with non-matching shape #4353

2015-06-05 Thread Sebastian Berg
On Do, 2015-06-04 at 18:04 -0700, Nathaniel Smith wrote: On Thu, Jun 4, 2015 at 5:57 PM, Nathaniel Smith n...@pobox.com wrote: So specifically the question is -- if you have an array with five items, and a Boolean array with three items, then currently you can use the later to index the

Re: [Numpy-discussion] variable end border in arrays

2015-06-05 Thread Sebastian Berg
On Fr, 2015-06-05 at 15:17 +0800, Pablo wrote: Hi, If I want to remove 1 element in the beginning and the end of a numpy array x we do: x[1:-1] Now, if we have a border variable, and borders are allowed to be zero (which means no border), numpy syntax is inconvenient. For example if

Re: [Numpy-discussion] DEP: Deprecate boolean array indices with non-matching shape #4353

2015-06-05 Thread josef.pktd
On Fri, Jun 5, 2015 at 3:16 AM, Sebastian Berg sebast...@sipsolutions.net wrote: On Do, 2015-06-04 at 18:04 -0700, Nathaniel Smith wrote: On Thu, Jun 4, 2015 at 5:57 PM, Nathaniel Smith n...@pobox.com wrote: So specifically the question is -- if you have an array with five items, and a

Re: [Numpy-discussion] DEP: Deprecate boolean array indices with non-matching shape #4353

2015-06-05 Thread josef.pktd
On Fri, Jun 5, 2015 at 11:50 AM, Anne Archibald archib...@astron.nl wrote: On Fri, Jun 5, 2015 at 5:45 PM Sebastian Berg sebast...@sipsolutions.net wrote: On Fr, 2015-06-05 at 08:36 -0400, josef.p...@gmail.com wrote: snip What is actually being deprecated? It looks like there are

Re: [Numpy-discussion] DEP: Deprecate boolean array indices with non-matching shape #4353

2015-06-05 Thread Anne Archibald
On Fri, Jun 5, 2015 at 5:45 PM Sebastian Berg sebast...@sipsolutions.net wrote: On Fr, 2015-06-05 at 08:36 -0400, josef.p...@gmail.com wrote: snip What is actually being deprecated? It looks like there are different examples. wrong length: Nathaniels first example above, where the

Re: [Numpy-discussion] DEP: Deprecate boolean array indices with non-matching shape #4353

2015-06-05 Thread Sebastian Berg
On Fr, 2015-06-05 at 08:36 -0400, josef.p...@gmail.com wrote: snip What is actually being deprecated? It looks like there are different examples. wrong length: Nathaniels first example above, where the mask is not broadcastable to original array because mask is longer or shorter than

Re: [Numpy-discussion] DEP: Deprecate boolean array indices with non-matching shape #4353

2015-06-05 Thread Benjamin Root
On Thu, Jun 4, 2015 at 10:41 PM, Nathaniel Smith n...@pobox.com wrote: My comment was about the second type. Are your comments about the second type? The second type definitely does not produce a flattened array: I was talking about the second type in that I never even knew it existed. My