I have aggregated data using pandas data frame. Below is some actual data shown and how I aggregated it.
fdf.groupby(['row',col'])['percent'].sum()
What I would like to do is create a 2d numpy array of this (rows = row, columns = col). Any slick way to do this ?
Another way I did something similar was create a pivot table
pivot_table(fdf,values='percent',rows='row',cols='col', aggfunc=np.sum)
In this case I want to convert this pivot table to 2d numpy array. Is there a way for me to index into each cell of this table. If so then I probably will be Ok with the table itself.