Hello,
I am using root-6.08.02 to make a variable binned histogram with PyROOT.
I find that this works:
from array import array
m = [400,450,500,550,600,650,700,750,800,850,900,950,1000,1150,1500]
h = ROOT.TH1D("h",";m [GeV];Events/ 50 GeV;;",len(m)-1,array('d',m))
but this doesn’t
import numpy as np
m = [400,450,500,550,600,650,700,750,800,850,900,950,1000,1150,1500]
h = ROOT.TH1D("h",";m [GeV];Events/ 50 GeV;;",len(m)-1,np.asarray(m))
I error I get is
Error in < TGaxis::PaintAxis >: length of axis is 0
when trying to draw the histogram booked using the numpy array.
Is this expected?