假设我有一个名为df的数据框
x count d 2 e 3 f 2
计数将是计数器列和#次我希望它重复.
我将如何扩展它来实现它
x count d 2 d 2 e 3 e 3 e 3 f 2 f 2
我已经尝试过numpy.repeat(df,df.iloc ['count'])并且它出错了
python expand dataframe pandas
dataframe ×1
expand ×1
pandas ×1
python ×1