I have a Pandas aggregate dataframe like this:
import pandas as pd
agg_df = pd.DataFrame({'v1':['item', 'item', 'item', 'item', 'location', 'status', 'status'],
'v2' :['bed', 'lamp', 'candle', 'chair', 'home', 'new', 'used' ],
'count':['2', '2', '2', '1', '7', '4', '3' ]})
agg_df
I want to prepare it for academic publication and I need a new dataframe like this:
# item bed 2
# lamp 2
# candle 2
# chair 1
# location home 7
# status new 4
# used 3
How can I create such a dataframe?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…