-
Dear experts, I am writing ROOT files using uproot. One problem I face is when a branch is empty, thus having unknown type, which cannot be written down with uproot. >>> ak.__version__
1.5.1
>>> uproot.__version__
4.3.7 This script ak_array = ak.Array([[], [], []])
ak_array = ak.values_astype(ak_array, np.float64)
tree = {"branch": ak_array}
with uproot.recreate("test.root") as file:
file["test"] = tree terminates with the following error:
And: >>> ak_array = ak.Array([[], [], []])
>>> ak.values_astype(ak_array, np.float64)
<Array [[], [], []] type='3 * var * unknown'> Is it possible to give a type to empty to empty awkward array? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
After some attempts, I found a trick by concatenating an ak array of the desired type, and filtering out the part that was concatenated. |
Beta Was this translation helpful? Give feedback.
-
Converted into an issue: scikit-hep/uproot5#822. And also #2188. |
Beta Was this translation helpful? Give feedback.
Converted into an issue: scikit-hep/uproot5#822.
And also #2188.