File tree 1 file changed +7
-1
lines changed
bindings/pyroot/pythonizations/python/ROOT/_pythonization
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -481,15 +481,21 @@ def pythonize_rdataframe(klass):
481
481
482
482
483
483
def _make_name_rvec_pair (key , value ):
484
+ import numpy as np
485
+
484
486
import ROOT
485
487
486
488
# Get name of key
487
489
if not isinstance (key , str ):
488
490
raise RuntimeError ("Object not convertible: Dictionary key is not convertible to a string." )
489
491
492
+ if not np .any (value ):
493
+ # If the array is empty, we convert the type from object to short to create a default empty RVec
494
+ value = value .astype (np .int16 )
495
+
490
496
# Convert value to RVec and attach to dictionary
491
497
pyvec = ROOT .VecOps .AsRVec (value )
492
- if not pyvec :
498
+ if not pyvec and np . any ( value ) :
493
499
raise RuntimeError ("Object not convertible: Dictionary entry " + key + " is not convertible with AsRVec." )
494
500
495
501
# Add pairs of column name and associated RVec to signature
You can’t perform that action at this time.
0 commit comments