scikit-hep/root_numpy

Reading of ROOT vector branches - 1D array inside 1D array

imoric opened this issue · 5 comments

Wondering if it is possible to read vector ROOT branches, 1D arrays of 1D arrays.
root_numpy seems to combine all the second degree 1D arrays inside the first degree 1D array, or am I missing something?

ndawe commented

Yes, vector<T> and vector<vector<T> > are supported where T is some primitive type.

ndawe commented

vector<T> gives you a column like [[a, b, c], [d, e]]
vector<vector<T> > gives you a column like [[[a, b], [c, d, e, f]], [[g]], [[h, i]]]

ndawe commented

Can you show a specific case where root_numpy is giving you something unexpected?

OK, just checked. Feel free to delete the thread.
The issue is with the ROOT file, all the vectors are bunched together.
Thank you!

ndawe commented

No problem!