
Feb. 12, 2013
5:53 p.m.
Hi, I'm trying to get a view on a sliced array without copy but I'm not able to do it as illustrated below: dtype = np.dtype( [('color', 'f4', 4)] ) Z = np.zeros(100, dtype=dtype) print Z.view('f4').base is Z # True print Z[:50].base is Z # True print (Z.view('f4'))[:50].base is Z # False print Z[:50].view('f4').base is Z # False Did I do something wrong or is it expected behavior ? Nicolas