[Numpy-discussion] Empty arrays strange behaviour
Nadav Horesh
nadavh at visionsense.com
Wed Aug 18 03:36:10 CDT 2004
>>> a = arange(20, shape=(4,5))
>>> a
array([[ 0, 1, 2, 3, 4],
[ 5, 6, 7, 8, 9],
[10, 11, 12, 13, 14],
[15, 16, 17, 18, 19]])
>>> a[2:4,5:7] # Shouldn't it raise index error?
array([])
>>> a[2:4, 5:7].iscontiguous()
0 # ????
>>> a[2:4, 5:7].copy().iscontiguous()
0 # ????
Shouldn't iscontiguous method of empty arrays and array.copy() return 1?
Nadav.
More information about the Numpy-discussion
mailing list