I am trying to sort by the 'acct' and group by the 'month'.
dataframe is this:
    acct       month   value
14    84  2014-09-30  393641
15    84  2014-10-31  393283
16    84  2014-11-30  383293
....
35    85  2014-10-31  291629
36    85  2014-11-30  289544
I do a pivot table
df2 = df.pivot_table ( index = ['month'], columns = "acct" )
This is the results:
                value     
acct              84       85
month                    
2014-09-30  393641.0       0.0
2014-10-31  393283.0  291629.0
2014-11-30  383293.0  289544.0
What is the best way to get values from the pivot?
I need to loop trough the 'value' to extract the data created for each account.
Thanks.
This is what worked for me to extract the data:
var = [ ]
for column in df2.columns.values:
    var.append ( df2 [ column ].tolist () )
