I have a pandas dataframe with name of variables, the values for each and the count
(which shows the frequency of that row):
df = pd.DataFrame({'var':['A', 'B', 'C'], 'value':[10, 20, 30], 'count':[1,2,3]})
var value count
A 10 1
B 20 2
C 30 3
I want to use count
to get an output like this:
var value
A 10
B 20
B 20
C 30
C 30
C 30
What is the best way to do that?