How to generate list with out for loop in python
ndf = df.loc[ np.repeat(df.index.values, df['Number']) ]
values = ndf['Capacity'].tolist()
# [5, 5, 30, 60, 90]


Repeat the rows you wish you duplicate using np.repeat, and then, takes the selected column (here, capacity) and turn it into a list using .tolist().