I have a list of string s = ['a', 'b', 'c']
I want to to get s = ['a','a','a','b','b','b','c','c','c']
I've tried vstack, then reshape but got s = ['a', 'b', 'c','a', 'b', 'c','a', 'b', 'c']
Is there any way to do that other than for loop?
here is the code:
a = ["a","b","c"]
a = np.array(a)
b = np.vstack((a,a,a))
b.reshape(-1)
array(['a', 'b', 'c', 'a', 'b', 'c', 'a', 'b', 'c'], dtype='<U1')