The question gets much clearer when an example is provided. I have a Data Frame with two columns, one of type string and one of type integer:
Col1 Col2
-------------
str1 2
str2 4
str3 1
now i need a list that contains the string in Col1 times the number in Col2, i.e. ['str1', 'str1', 'str2', 'str2', 'str2', 'str2', 'str3'].
What is the most efficient way to do so?
np.repeat(df['Col1'], df['Col2']).