I have an array of binary elements size (100,)
.
I'd like to copy it 8 times, keeping the elements the same and store it as a new array size (800,)
np.copy()
can copy it once, but how can I go about copying it 8 times?
I have an array of binary elements size (100,)
.
I'd like to copy it 8 times, keeping the elements the same and store it as a new array size (800,)
np.copy()
can copy it once, but how can I go about copying it 8 times?
You can use use numpy.repeat. It repeats array's elements by specifying repeat number:
new_arr = numpy.repeat(old_arr, 8)