Replies: 1 comment
-
Ideally, you'd want to make a profile-style histogram with hist (maybe the WeightedMean Storage type) and assign that into an uproot.WritableDirectory. Unfortunately, it doesn't look like Uproot recognizes that hist type directly: uproot5/src/uproot/writing/identify.py Lines 248 to 251 in 130c55b If Uproot had recognized this histogram type, it would use uproot5/src/uproot/writing/identify.py Lines 1552 to 1593 in 130c55b The problem to be solved is knowing how to convert from the profile-like histogram you have into the arguments for this function. Once that's solved, the output of this function can be assigned directly into the directory: with uproot.recreate("some_file.root") as file:
file["some_profile"] = uproot.writing.identify.to_TProfile(...) Conversion in the other direction exists: if Uproot extracts a uproot5/src/uproot/behaviors/TProfile.py Lines 296 to 332 in 130c55b You'd want to reverse that transformation. If you do solve this inverse transformation, we'd be in a good position to add it to uproot/writing/identify.py, so that there won't be a |
Beta Was this translation helpful? Give feedback.
-
I am new to uproot, but I have noticed that it is able to recognize histogram types in files created by Root. I was wondering if it is possible to create an histogram profile with uproot and store it in a root file.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions