Hi, since now I use the following commands for some analysis :
f_root = ROOT.TFile(pathDATA + item)
h_rel = gr.getHisto(f_root, tp_1)
for i in range(0, N_histos):
histo_rel = h_rel.Get(branches[i])
print('[{:03d}] : {:s}'.format(i, branches[i]))
if (histo_rel):
s_new = []
for entry in histo:
s_new.append(entry)
s_new = np.asarray(s_new)
s_new = s_new[1:-1]
but since the 6.36.00 version of ROOT, I have the following error :
> File "/usr/lib64/python3.9/site-packages/ROOT/_pythonization/_uhi.py", line 367, in _getitem
> uhi_index = _compute_common_index(self, index)
> File "/usr/lib64/python3.9/site-packages/ROOT/_pythonization/_uhi.py", line 223, in _compute_common_index
> return [_compute_uhi_index(self, idx, axis, include_flow_bins) for axis, idx in enumerate(index)]
> File "/usr/lib64/python3.9/site-packages/ROOT/_pythonization/_uhi.py", line 223, in <listcomp>
> return [_compute_uhi_index(self, idx, axis, include_flow_bins) for axis, idx in enumerate(index)]
> File "/usr/lib64/python3.9/site-packages/ROOT/_pythonization/_uhi.py", line 192, in _compute_uhi_index
> return _process_index_for_axis(self, index, axis)
> File "/usr/lib64/python3.9/site-packages/ROOT/_pythonization/_uhi.py", line 180, in _process_index_for_axis
> raise IndexError(f"Histogram index {index - 1} out of range for axis {axis}. Valid range: (0,{nbins})")
> IndexError: Histogram index 11 out of range for axis 0. Valid range: (0,11)
In fact, I saw that I do not need the last line of my version ( s_new = s_new[1:-1] ) but it seems that if the loop begins with 1, it ends with 11 (in my example) instead of 10 (nbins+1 instead of nbins).
Is there a correct way to correct this ?
Thanks in adcance.
Arnaud
Please read tips for efficient and successful posting and posting code
_ROOT Version: 6.36.00
Platform: lxplus
Compiler: python3