Open PerilousApricot opened 4 years ago
Seems like the pandas conversion is trying to create a new type that pandas will eat, but messes up.
Depending on the use case, it might be worth moving to awkward1. An early implementation of vector types is now available in coffea.nanoevents.methods
. Here's an example:
import awkward1
import coffea.nanoevents.methods # the import registers the types in awkward1.behavior
ex = awkward1.Array([ [1.0], [2.0, 3.0] ])
p4 = awkward1.zip({"pt": ex, "eta": ex, "phi": ex, "mass": ex}, with_name="PtEtaPhiMLorentzVector")
print(awkward1.pandas.df(p4))
p4c = awkward1.cartesian([p4, p4])
# this should have worked but there seems to be a bug
awkward1.pandas.df(p4c)
Made an issue: https://github.com/scikit-hep/awkward-1.0/issues/331
Thanks for the response! I'll try moving this code forward to awkward1
I'm unsure if this belongs here or perhaps with awkward (though I think it is here).
The following reduced snippet:
Throws
with
There's a couple of different ways to trigger whatever's happening, but they all involve taking the cross product of a TLorentzVector (the same operation with floats succeeds).