Tag: pandas
-
Repeat rows in DataFrame with respect to column
7 I have a Pandas DataFrame that looks like this: df = pd.DataFrame({‘col1’: [1, 2, 3], ‘col2’: [4, 5, 6], ‘col3’: [7, 8, 9]}) df col1 col2 col3 0 1 4 7 1 2 5 8 2 3 6 9 I would like to create a Pandas DataFrame like this: df_new col1 col2 col3 0…