I\'m trying repeat the rows of a dataframe. Here\'s my original data:
pd.DataFrame([ {\'col1\': 1, \'col2\': 11, \'col3\': [1, 2] }, {\'col1\
You can use a list comprehension together with zip.
zip
>>> pd.DataFrame([row for row, count in zip(df[['col1', 'col2']].values, df['col3']) for _ in range(len(count))], columns=df.columns[:2]) col1 col2 0 1 11 1 1 11 2 2 22 3 2 22 4 2 22 5 3 33 6 4 44 7 4 44 8 4 44 9 4 44