Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to copy items in list n times in list python

In [16]:

x1=[1,2,3,4]
In [17]:

np.repeat(x1,3)
Out[17]:
array([1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4])
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #copy #items #list #times #list #python
ADD COMMENT
Topic
Name
5+9 =