Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Histogram help
#1


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?
Quote
#2
It is difficult to help, without some lines from Luton.csv
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  How to fit a 2D histogram like in ROOT? Zandar 2 717 Aug-06-2019, 03:01 PM
Last Post: Zandar
  histogram error alyssaantarctica 1 803 Jul-09-2018, 10:46 PM
Last Post: Larz60+
  histogram with matplotlib vaugirard 10 1,805 Jun-01-2018, 04:13 AM
Last Post: vaugirard
  Help creating a histogram using an array rubadub 0 718 Apr-17-2018, 08:57 PM
Last Post: rubadub
  plotting histogram vvv 1 1,438 Mar-10-2017, 11:47 PM
Last Post: zivoni

Forum Jump:


Users browsing this thread: 1 Guest(s)