Re: [Numpy-discussion] Why does np.repeat build a full array?

2015-12-15 Thread Juan Nunez-Iglesias
On Tue, Dec 15, 2015 at 8:29 PM, Sebastian Berg wrote: > Actually, your particular use-case is covered by the new `broadcast_to` > function. > So it is! Fascinating, thanks for pointing that out! =) ___ NumPy-Discussion mailing list NumPy-Discussion@sc

Re: [Numpy-discussion] Why does np.repeat build a full array?

2015-12-15 Thread Sebastian Berg
On Di, 2015-12-15 at 08:56 +0100, Sebastian Berg wrote: > On Di, 2015-12-15 at 17:49 +1100, Juan Nunez-Iglesias wrote: > > Hi, > > > > > > I've recently been using the following pattern to create arrays of a > > specific repeating value: > > > > > > from numpy.lib.stride_tricks import as_stride

Re: [Numpy-discussion] Why does np.repeat build a full array?

2015-12-14 Thread Sebastian Berg
On Di, 2015-12-15 at 17:49 +1100, Juan Nunez-Iglesias wrote: > Hi, > > > I've recently been using the following pattern to create arrays of a > specific repeating value: > > > from numpy.lib.stride_tricks import as_strided > > value = np.ones((1,), dtype=float) > arr = as_strided(value, shape=

[Numpy-discussion] Why does np.repeat build a full array?

2015-12-14 Thread Juan Nunez-Iglesias
Hi, I've recently been using the following pattern to create arrays of a specific repeating value: from numpy.lib.stride_tricks import as_strided value = np.ones((1,), dtype=float) arr = as_strided(value, shape=input_array.shape, strides=(0,)) I can then use arr e.g. to count certain pairs of el