>>> np.array([0,1,2,3])[1:-1]
array([1, 2])
but
>>> np.array([0,1,2,3])[np.s_[1:-1]]
array([1, 2, 3])
>>> np.array([0,1,2,3])[np.index_exp[1:-1]]
array([1, 2, 3])
Possible fix:
class IndexExpression(object):
...
def __len__(self):
return 0
(Presently this returns sys.maxin
On Fri, Jun 5, 2009 at 16:14, Michael McNeil Forbes
wrote:
> >>> np.array([0,1,2,3])[1:-1]
> array([1, 2])
>
> but
>
> >>> np.array([0,1,2,3])[np.s_[1:-1]]
> array([1, 2, 3])
> >>> np.array([0,1,2,3])[np.index_exp[1:-1]]
> array([1, 2, 3])
>
> Possible fix:
> class IndexExpression(object):
>
Submitted as ticket 1196
http://projects.scipy.org/numpy/ticket/1196
On 5 Jun 2009, at 4:12 PM, Robert Kern wrote:
> On Fri, Jun 5, 2009 at 16:14, Michael McNeil Forbes
> wrote:
>> >>> np.array([0,1,2,3])[1:-1]
>> array([1, 2])
>>
>> but
>>
>> >>> np.array([0,1,2,3])[np.s_[1:-1]]
>> array([1,