Replies: 1 comment
-
It's not a matter of not closing correctly, since you're using a What seems to be happening here is a more general kind of bug on the Uproot side. You'll have to show me (1) a copy of a pre-updated file, (2) what steps you take to write to it with a dummy DataFrame, not your whole analysis, just one that can be created on the command line, and (3) how it fails to be re-openable with That should be opened as an issue, rather than a discussion. |
Beta Was this translation helpful? Give feedback.
-
Hi! I'm trying to use a SciKit classifier on some data by reading it in from multiple ROOT TTrees to Pandas DataFrames (so I use uproot.open()). I then want to update the existing files with the classification data (e.g. confidence scores/probabilities etc) using uproot.update(). I'm having trouble with updating the files as they don't seem to be closing correctly despite being opened in a with statement. I've tried different ways of updating the files (below) but they all lead to the following error when I open the file in ROOT to check:
I think this means it's not closing correctly? If I then retry the python code with the same ROOT file I get an error when trying to open it in a writable form using uproot.update() (but no error when using uproot.open()), I'm assuming because it's been corrupted: (FYI I have updated to uproot 4.1.5)
ValueError: Uproot can't read TKey version -1 for writing, only version 4
This is the code for two ways I've tried updating the file:
(I've also tried this way inside a with statement).
Hope I've explained this ok, any help would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions