[scikit-learn] using numpy repeat

Nicolas Hug niourf at gmail.com
Mon Oct 14 13:56:41 EDT 2019


You're looking for np.tile. It's one of the first google results and 
it's also linked in the doc of np.repeat.

This mailing-list is for questions related to scikit-learn. I think your 
question would be more appropriate for e.g. stack-overflow.


On 10/14/19 1:55 PM, Glenn Schultz via scikit-learn wrote:
> I am tying to repeat an array 3 times using the following
>
> numpy.repeat(numpy.linspace(-.5, 3, 8), 3) axis = 0)
>
> although this repeats each element 3 times sequentially. I trying to 
> repeat the array
> -.5 -0 .5 ... -5 -0 .5
>
> any suggestions to accomplish this are appreciated.   I am relatively 
> sure I can do this with numpy I just can't put my finger on how this 
> is done by reviewing the numpy docs.
>
> Thanks,
> Glenn
>
> _______________________________________________
> scikit-learn mailing list
> scikit-learn at python.org
> https://mail.python.org/mailman/listinfo/scikit-learn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20191014/498a39fe/attachment.html>


More information about the scikit-learn mailing list