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 exam

[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 x[border[0],-bo