newarr[tuple(slice(0, i) for i in oldarray.shape)] = oldarray On Mon, Jul 13, 2015 at 12:34 PM, Neal Becker <ndbeck...@gmail.com> wrote:
> I want to copy an array to the corner of a new array. What is a dimension > independent way to say: > > newarr[:i0,:i1,...] = oldarray > > where (i0,i1...) is oldarray.shape? > > _______________________________________________ > NumPy-Discussion mailing list > NumPy-Discussion@scipy.org > http://mail.scipy.org/mailman/listinfo/numpy-discussion > -- Robert Kern
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion