Nov-20-2017, 11:54 AM
I want to group the categorical variable values (Materials) from an attribute (arr1) and plot against their corresponding numerical totals? (first the totals in 'arr2' & then in 'arr3')
data = pd.read_csv('Luton1516_DD.csv') numpyArray = data.as_matrix(["Material", "DD_ComingledTonnes","DD_SegregatedTonnes"]) arr1 = numpyArray[:,0] arr2 = numpyArray[:,1] arr3 = numpyArray[:,2] df1 = pd.DataFrame({'A': arr2,'group': arr1}) df1.pivot(columns='group', values='A').plot.hist(stacked=True)Can anyone offer help with this?