I have a numpy.ndarray
with True
/False
:
import numpy as np
a = np.array([True, True, False])
I want:
out = np.array([True, True, False, True, True, False, True, True, False])
I tried:
np.repeat(a, 3, axis = 0)
But it duplicates each element, I want to duplicate the all array.
This is the closes I got:
np.array([a for i in range(3)])
However, I want it to stay as 1D.
Edit
It was suggested to be a duplicate of Repeating each element of a numpy array 5 times. However, my question was how to repeat the all array and not each element.