Code Monkey home page Code Monkey logo

Comments (4)

jonas-eschle avatar jonas-eschle commented on June 5, 2024

I think this is not supported in root_pandas (but I may be incorrect!). To my knowledge, root_pandas actively prevents this case to happen (at least it was like that before AFAIK).
You can either use the flattening and have each entry in a single column or do what you really want by using root_numpy:

ar1 = root_numpy.root2array(filenames="rootfile.root",
                            treename='tree',
                            branches=['branch_with_array'])
df = pd.DataFrame(ar1)

(it used to work like that. If things changed in the mean time and this is not working anymore, let me know)

from root_pandas.

nfoppiani avatar nfoppiani commented on June 5, 2024

Ok it seems you are right, though I found this commit
28f2097#diff-f1a13e96d09db54e1548192242ca5ce4

in which it was decided to skip the non-scalar branches (it seems this functionality used to be supported before)

from root_pandas.

jonas-eschle avatar jonas-eschle commented on June 5, 2024

Yes, exactly. As said, it is (unfortunately!) actively suppressed in root_pandas as it is fully implemented in root_numpy (root_pandas uses internally root_numpy). Remove that piece of code and it will (presumably) work again.

That's why I still stick with root_numpy: it is too easy to convert to a DataFrame (see snippet above) and allows to convert arrays.

from root_pandas.

chrisburr avatar chrisburr commented on June 5, 2024

This is now supported in v0.3.1.

from root_pandas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.