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
mfor...@physics.ubc.ca wrote:
np.array([0,1,2,3])[1:-1]
array([1, 2])
but
np.array([0,1,2,3])[np.s_[1:-1]]
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.maxint)
Does
On Fri, Jun 5, 2009 at 16:14, Michael McNeil Forbes
mfor...@physics.ubc.ca 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):