Skip to content

Commit c605857

Browse files
committed
Updated conditions and delegate method to numba.jit
1 parent 7365079 commit c605857

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pandas/core/apply.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
cast,
1414
)
1515

16+
import numba
1617
import numpy as np
1718

1819
from pandas._libs.internals import BlockValuesRefs
@@ -1148,8 +1149,9 @@ def wrapper(*args, **kwargs):
11481149
return wrapper
11491150

11501151
if engine == "numba":
1151-
engine_obj = NumbaExecutionEngine()
1152-
result = engine_obj.apply(
1152+
if not hasattr(numba.jit, "__pandas_udf__"):
1153+
numba.jit.__pandas_udf__ = NumbaExecutionEngine
1154+
result = numba.jit.__pandas_udf__.apply(
11531155
self.values,
11541156
self.func,
11551157
self.args,

0 commit comments

Comments
 (0)