-
Notifications
You must be signed in to change notification settings - Fork 87
Description
I'm a newbie to uproot and encountered some problems when trying to use uproot. Sorry for possible misunderstandings of the usage, though I think my expectation might be reasonable.
Create a jagged array
import uproot
import awkward as ak
array = ak.Array({'a': [[1.1, 2.2, 3.3], [], [4.4, 5.5]], 'b': [[1.1, 2.2, 3.3], [], [4.4, 5.5]], 'c': [1, 2, 3]})and save it to a ROOT file
with uproot.recreate('data.root') as output_file:
output_file['tree'] = arrayI expect that the saved tree has 3 branches
name | typename | interpretation
---------------------+--------------------------+-------------------------------
a | double[] | AsJagged(AsDtype('>f8'))
b | double[] | AsJagged(AsDtype('>f8'))
c | int64_t | AsDtype('>i8')
but actually I got errors
TypeError: fields of a record must be NumPy types, though the record itself may be in a jagged array
field 'a' has type var * float64
This situation easily happens when reading a TTree with variable length arrays and then saving it back after some manipulations.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status