File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -312,13 +312,15 @@ def function(datum):
312
312
if numpy is not None :
313
313
context ["numpy" ] = numpy
314
314
context ["np" ] = numpy
315
+ major = int (numpy .__version__ .split ('.' )[0 ])
316
+ npcore = numpy ._core if major > 1 else numpy .core
315
317
316
318
# if the datum is a dict, override the namespace with its dict keys
317
319
if isinstance (datum , dict ): # if it's a dict
318
320
context .update (datum ) # use its items as variables
319
321
320
322
# if the datum is a Numpy record array, override the namespace with its field names
321
- elif numpy is not None and isinstance (datum , numpy . _core .records .recarray ):
323
+ elif numpy is not None and isinstance (datum , npcore .records .recarray ):
322
324
context .update (dict ((n , datum [n ]) for n in datum .dtype .names ))
323
325
324
326
# if the datum is a Pandas DataFrame, override the namespace with its column names
You can’t perform that action at this time.
0 commit comments