Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
388 views
in Technique[技术] by (71.8m points)

uproot - Model_TH3D_v3 on uproot4

I am trying to import a TH3 v3 file from .root, but I get the following error message:

----> 3 a=fileRCL[filename].to_numpy()

~/anaconda3/lib/python3.8/site-packages/uproot/behaviors/TH3.py in to_numpy(self, flow, dd)
    100         """
    101         values = self.values(flow=flow)
--> 102         xedges = self.edges(0)
    103         yedges = self.edges(1)
    104         zedges = self.edges(2)

AttributeError: 'Model_TH3D_v3' object has no attribute 'edges'

As you can see, the object is accessible from root browser and has the edges.

original file

Any idea? uproot4 Ubuntu 20.04 vscode insider 1.52 conda 4.9.2 python 3.9


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This is a bug, caused by interface changes needed to adopt to Scikit-HEP's unified histogram protocol while not explicitly testing TH3 (3-dimensional histograms) because I didn't have any examples in scikit-hep-testdata.

Can you confirm that scikit-hep/uproot4#239 fixes your issue? Thanks!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...