Hi Vincent 2009/2/17 Vincent Schut <sc...@sarvision.nl>: > Hi list, > > would it be possible to create a view on an array, such that this view > is twice as large (in some dimensions) and in fact does a nearest > neighbour 'zoom' on the original array? E.g. using some fancy > slicing/striding tricks? > > an example: > > a = [[1, 2], > [3, 4]] > > then I'd like a view on a such that this view is: > > [[1, 1, 2, 2], > [1, 1, 2, 2], > [3, 3, 4, 4], > [3, 3, 4, 4]]
np.lib.stride_tricks.as_strided(x, (2, 2, 2, 2), (8, 0, 4, 0)).reshape((4, 4)) Cheers Stéfan _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion