Closed Blue-EyesChaosMaxDragon closed 3 months ago
As a workaround, it is possible to write the array with string to the TTree when switching to from numpy to awkward:
import uproot
import awkward as ak
file = uproot.recreate("example.root")
file["DecayTree"] = {"x": ak.Array(["A","B"]), "y": ak.Array([1,2])}
file["DecayTree"].extend({"x": ak.Array(["A","B"]), "y": ak.Array([1,2])})
Thanks for catching this! It should be fixed in #1266.
Tested with uproot version 5.3.10. When trying to write
numpy
arrays to a TTree and one of the arrays contains strings (using theuproot.AsStrings
interpretation), the code crashes. Here is a minimal example message to reproduce the error:This code snippet produces the following error: