From d77bafe7c0bdfb9fe85f3fbc1cea493049d6e2c4 Mon Sep 17 00:00:00 2001 From: Matt Roeschke Date: Tue, 7 Jul 2020 21:25:45 -0700 Subject: [PATCH 1/8] Add configuration for global numba usage --- pandas/core/config_init.py | 17 +++++++++++++++++ pandas/core/util/numba_.py | 8 ++++++++ 2 files changed, 25 insertions(+) diff --git a/pandas/core/config_init.py b/pandas/core/config_init.py index 54d23fe8829e6..86f6be77bc505 100644 --- a/pandas/core/config_init.py +++ b/pandas/core/config_init.py @@ -52,6 +52,20 @@ def use_numexpr_cb(key): expressions.set_use_numexpr(cf.get_option(key)) +use_numba_doc = """ +: bool + Use the numba engine option for select operations if it is installed, + the default is False + Valid values: False,True +""" + + +def use_numba_cb(key): + from pandas.core.util import numba_ + + numba_.set_use_numba(cf.get_option(key)) + + with cf.config_prefix("compute"): cf.register_option( "use_bottleneck", @@ -63,6 +77,9 @@ def use_numexpr_cb(key): cf.register_option( "use_numexpr", True, use_numexpr_doc, validator=is_bool, cb=use_numexpr_cb ) + cf.register_option( + "use_numba", False, use_numba_doc, validator=is_bool, cb=use_numba_cb + ) # # options from the "display" namespace diff --git a/pandas/core/util/numba_.py b/pandas/core/util/numba_.py index c3f60ea7cc217..179f7e4c12c65 100644 --- a/pandas/core/util/numba_.py +++ b/pandas/core/util/numba_.py @@ -10,9 +10,17 @@ from pandas.compat._optional import import_optional_dependency from pandas.errors import NumbaUtilError +GLOBAL_USE_NUMBA: bool = False NUMBA_FUNC_CACHE: Dict[Tuple[Callable, str], Callable] = dict() +def set_use_numba(enable: bool = False) -> None: + global GLOBAL_USE_NUMBA + if enable: + import_optional_dependency("numba") + GLOBAL_USE_NUMBA = enable + + def check_kwargs_and_nopython( kwargs: Optional[Dict] = None, nopython: Optional[bool] = None ) -> None: From cc01ea95648e8f8b208c4ff62b4898abb55402af Mon Sep 17 00:00:00 2001 From: Matt Roeschke Date: Tue, 7 Jul 2020 21:37:07 -0700 Subject: [PATCH 2/8] Change function engine defaults to None --- pandas/core/groupby/generic.py | 8 ++++---- pandas/core/groupby/groupby.py | 6 ++++-- pandas/core/window/rolling.py | 5 +++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/pandas/core/groupby/generic.py b/pandas/core/groupby/generic.py index ebb9d82766c1b..a219b6841cba0 100644 --- a/pandas/core/groupby/generic.py +++ b/pandas/core/groupby/generic.py @@ -229,7 +229,7 @@ def apply(self, func, *args, **kwargs): _agg_template, examples=_agg_examples_doc, klass="Series", ) def aggregate( - self, func=None, *args, engine="cython", engine_kwargs=None, **kwargs + self, func=None, *args, engine=None, engine_kwargs=None, **kwargs ): relabeling = func is None @@ -481,7 +481,7 @@ def _aggregate_named(self, func, *args, **kwargs): @Substitution(klass="Series") @Appender(_transform_template) - def transform(self, func, *args, engine="cython", engine_kwargs=None, **kwargs): + def transform(self, func, *args, engine=None, engine_kwargs=None, **kwargs): func = self._get_cython_func(func) or func if not isinstance(func, str): @@ -934,7 +934,7 @@ class DataFrameGroupBy(GroupBy[DataFrame]): _agg_template, examples=_agg_examples_doc, klass="DataFrame", ) def aggregate( - self, func=None, *args, engine="cython", engine_kwargs=None, **kwargs + self, func=None, *args, engine=None, engine_kwargs=None, **kwargs ): relabeling = func is None and is_multi_agg_with_relabel(**kwargs) @@ -1458,7 +1458,7 @@ def _transform_general( @Substitution(klass="DataFrame") @Appender(_transform_template) - def transform(self, func, *args, engine="cython", engine_kwargs=None, **kwargs): + def transform(self, func, *args, engine=None, engine_kwargs=None, **kwargs): # optimized transforms func = self._get_cython_func(func) or func diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index d039b715b3c08..ad573ee3ea43e 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -286,9 +286,10 @@ class providing the base-class of operations. .. versionchanged:: 1.1.0 *args Positional arguments to pass to func -engine : str, default 'cython' +engine : str, default None * ``'cython'`` : Runs the function through C-extensions from cython. * ``'numba'`` : Runs the function through JIT compiled code from numba. + * ``None`` : Defaults to ``'cython'`` or global numba configuration. .. versionadded:: 1.1.0 engine_kwargs : dict, default None @@ -393,9 +394,10 @@ class providing the base-class of operations. .. versionchanged:: 1.1.0 *args Positional arguments to pass to func -engine : str, default 'cython' +engine : str, default None * ``'cython'`` : Runs the function through C-extensions from cython. * ``'numba'`` : Runs the function through JIT compiled code from numba. + * ``None`` : Defaults to ``'cython'`` or global numba configuration. .. versionadded:: 1.1.0 engine_kwargs : dict, default None diff --git a/pandas/core/window/rolling.py b/pandas/core/window/rolling.py index 8cb53ebd92214..809737818dd37 100644 --- a/pandas/core/window/rolling.py +++ b/pandas/core/window/rolling.py @@ -1298,10 +1298,11 @@ def count(self): objects instead. If you are just applying a NumPy reduction function this will achieve much better performance. - engine : str, default 'cython' + engine : str, default None * ``'cython'`` : Runs rolling apply through C-extensions from cython. * ``'numba'`` : Runs rolling apply through JIT compiled code from numba. Only available when ``raw`` is set to ``True``. + * ``None`` : Defaults to ``'cython'`` or global numba configuration. .. versionadded:: 1.0.0 @@ -2056,7 +2057,7 @@ def apply( self, func, raw=False, - engine="cython", + engine=None, engine_kwargs=None, args=None, kwargs=None, From 7b01065e1762757ed3f4cf8433365f326c3e0096 Mon Sep 17 00:00:00 2001 From: Matt Roeschke Date: Fri, 10 Jul 2020 23:23:26 -0700 Subject: [PATCH 3/8] Add maybe_use_numba --- pandas/core/groupby/generic.py | 19 ++++++++----------- pandas/core/groupby/groupby.py | 3 ++- pandas/core/groupby/ops.py | 7 ++++--- pandas/core/util/numba_.py | 5 +++++ pandas/core/window/rolling.py | 34 ++++++++++++++-------------------- 5 files changed, 33 insertions(+), 35 deletions(-) diff --git a/pandas/core/groupby/generic.py b/pandas/core/groupby/generic.py index 6ad05e738e6c1..fbd86888d2e57 100644 --- a/pandas/core/groupby/generic.py +++ b/pandas/core/groupby/generic.py @@ -80,6 +80,7 @@ from pandas.core.util.numba_ import ( NUMBA_FUNC_CACHE, generate_numba_func, + maybe_use_numba, split_for_numba, ) @@ -227,9 +228,7 @@ def apply(self, func, *args, **kwargs): @doc( _agg_template, examples=_agg_examples_doc, klass="Series", ) - def aggregate( - self, func=None, *args, engine=None, engine_kwargs=None, **kwargs - ): + def aggregate(self, func=None, *args, engine=None, engine_kwargs=None, **kwargs): relabeling = func is None columns = None @@ -512,7 +511,7 @@ def _transform_general( Transform with a non-str `func`. """ - if engine == "numba": + if maybe_use_numba(engine): numba_func, cache_key = generate_numba_func( func, engine_kwargs, kwargs, "groupby_transform" ) @@ -522,7 +521,7 @@ def _transform_general( results = [] for name, group in self: object.__setattr__(group, "name", name) - if engine == "numba": + if maybe_use_numba(engine): values, index = split_for_numba(group) res = numba_func(values, index, *args) if cache_key not in NUMBA_FUNC_CACHE: @@ -931,13 +930,11 @@ class DataFrameGroupBy(GroupBy[DataFrame]): @doc( _agg_template, examples=_agg_examples_doc, klass="DataFrame", ) - def aggregate( - self, func=None, *args, engine=None, engine_kwargs=None, **kwargs - ): + def aggregate(self, func=None, *args, engine=None, engine_kwargs=None, **kwargs): relabeling, func, columns, order = reconstruct_func(func, **kwargs) - if engine == "numba": + if maybe_use_numba(engine): return self._python_agg_general( func, *args, engine=engine, engine_kwargs=engine_kwargs, **kwargs ) @@ -1378,7 +1375,7 @@ def _transform_general( applied = [] obj = self._obj_with_exclusions gen = self.grouper.get_iterator(obj, axis=self.axis) - if engine == "numba": + if maybe_use_numba(engine): numba_func, cache_key = generate_numba_func( func, engine_kwargs, kwargs, "groupby_transform" ) @@ -1388,7 +1385,7 @@ def _transform_general( for name, group in gen: object.__setattr__(group, "name", name) - if engine == "numba": + if maybe_use_numba(engine): values, index = split_for_numba(group) res = numba_func(values, index, *args) if cache_key not in NUMBA_FUNC_CACHE: diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index ad573ee3ea43e..c01b0b5553ed4 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -65,6 +65,7 @@ class providing the base-class of operations. from pandas.core.indexes.api import CategoricalIndex, Index, MultiIndex from pandas.core.series import Series from pandas.core.sorting import get_group_index_sorter +from pandas.core.util.numba_ import maybe_use_numba _common_see_also = """ See Also @@ -1065,7 +1066,7 @@ def _python_agg_general( # agg_series below assumes ngroups > 0 continue - if engine == "numba": + if maybe_use_numba(engine): result, counts = self.grouper.agg_series( obj, func, diff --git a/pandas/core/groupby/ops.py b/pandas/core/groupby/ops.py index 74db87f46c5e2..3aaeef3b63760 100644 --- a/pandas/core/groupby/ops.py +++ b/pandas/core/groupby/ops.py @@ -58,6 +58,7 @@ from pandas.core.util.numba_ import ( NUMBA_FUNC_CACHE, generate_numba_func, + maybe_use_numba, split_for_numba, ) @@ -620,7 +621,7 @@ def agg_series( # Caller is responsible for checking ngroups != 0 assert self.ngroups != 0 - if engine == "numba": + if maybe_use_numba(engine): return self._aggregate_series_pure_python( obj, func, *args, engine=engine, engine_kwargs=engine_kwargs, **kwargs ) @@ -678,7 +679,7 @@ def _aggregate_series_pure_python( **kwargs, ): - if engine == "numba": + if maybe_use_numba(engine): numba_func, cache_key = generate_numba_func( func, engine_kwargs, kwargs, "groupby_agg" ) @@ -691,7 +692,7 @@ def _aggregate_series_pure_python( splitter = get_splitter(obj, group_index, ngroups, axis=0) for label, group in splitter: - if engine == "numba": + if maybe_use_numba(engine): values, index = split_for_numba(group) res = numba_func(values, index, *args) if cache_key not in NUMBA_FUNC_CACHE: diff --git a/pandas/core/util/numba_.py b/pandas/core/util/numba_.py index 179f7e4c12c65..c9b7943478cdd 100644 --- a/pandas/core/util/numba_.py +++ b/pandas/core/util/numba_.py @@ -14,6 +14,11 @@ NUMBA_FUNC_CACHE: Dict[Tuple[Callable, str], Callable] = dict() +def maybe_use_numba(engine: Optional[str]) -> bool: + """Signal whether to use numba routines.""" + return engine == "numba" or (engine is None and GLOBAL_USE_NUMBA) + + def set_use_numba(enable: bool = False) -> None: global GLOBAL_USE_NUMBA if enable: diff --git a/pandas/core/window/rolling.py b/pandas/core/window/rolling.py index 809737818dd37..80269ffabaa8a 100644 --- a/pandas/core/window/rolling.py +++ b/pandas/core/window/rolling.py @@ -39,7 +39,7 @@ import pandas.core.common as com from pandas.core.construction import extract_array from pandas.core.indexes.api import Index, MultiIndex, ensure_index -from pandas.core.util.numba_ import NUMBA_FUNC_CACHE +from pandas.core.util.numba_ import NUMBA_FUNC_CACHE, maybe_use_numba from pandas.core.window.common import ( WindowGroupByMixin, _doc_template, @@ -1358,18 +1358,7 @@ def apply( if not is_bool(raw): raise ValueError("raw parameter must be `True` or `False`") - if engine == "cython": - if engine_kwargs is not None: - raise ValueError("cython engine does not accept engine_kwargs") - # Cython apply functions handle center, so don't need to use - # _apply's center handling - window = self._get_window() - offset = calculate_center_offset(window) if self.center else 0 - apply_func = self._generate_cython_apply_func( - args, kwargs, raw, offset, func - ) - center = False - elif engine == "numba": + if maybe_use_numba(engine): if raw is False: raise ValueError("raw must be `True` when using the numba engine") cache_key = (func, "rolling_apply") @@ -1381,6 +1370,17 @@ def apply( args, kwargs, func, engine_kwargs ) center = self.center + elif engine in ("cython", None): + if engine_kwargs is not None: + raise ValueError("cython engine does not accept engine_kwargs") + # Cython apply functions handle center, so don't need to use + # _apply's center handling + window = self._get_window() + offset = calculate_center_offset(window) if self.center else 0 + apply_func = self._generate_cython_apply_func( + args, kwargs, raw, offset, func + ) + center = False else: raise ValueError("engine must be either 'numba' or 'cython'") @@ -2054,13 +2054,7 @@ def count(self): @Substitution(name="rolling") @Appender(_shared_docs["apply"]) def apply( - self, - func, - raw=False, - engine=None, - engine_kwargs=None, - args=None, - kwargs=None, + self, func, raw=False, engine=None, engine_kwargs=None, args=None, kwargs=None, ): return super().apply( func, From f1c157cd709251333f1a082d58921e208104e411 Mon Sep 17 00:00:00 2001 From: Matt Roeschke Date: Sat, 11 Jul 2020 21:04:23 -0700 Subject: [PATCH 4/8] Test new context configuration --- pandas/tests/groupby/aggregate/test_numba.py | 17 ++++++++++++++++- pandas/tests/groupby/transform/test_numba.py | 17 ++++++++++++++++- pandas/tests/window/test_numba.py | 14 +++++++++++++- 3 files changed, 45 insertions(+), 3 deletions(-) diff --git a/pandas/tests/groupby/aggregate/test_numba.py b/pandas/tests/groupby/aggregate/test_numba.py index 726d79535184a..690694b0e66f5 100644 --- a/pandas/tests/groupby/aggregate/test_numba.py +++ b/pandas/tests/groupby/aggregate/test_numba.py @@ -4,7 +4,7 @@ from pandas.errors import NumbaUtilError import pandas.util._test_decorators as td -from pandas import DataFrame +from pandas import DataFrame, option_context import pandas._testing as tm from pandas.core.util.numba_ import NUMBA_FUNC_CACHE @@ -113,3 +113,18 @@ def func_2(values, index): result = grouped.agg(func_1, engine="numba", engine_kwargs=engine_kwargs) expected = grouped.agg(lambda x: np.mean(x) - 3.4, engine="cython") tm.assert_equal(result, expected) + + +@td.skip_if_no("numba", "0.46.0") +def test_use_global_config(): + def func_1(values, index): + return np.mean(values) - 3.4 + + data = DataFrame( + {0: ["a", "a", "b", "b", "a"], 1: [1.0, 2.0, 3.0, 4.0, 5.0]}, columns=[0, 1], + ) + grouped = data.groupby(0) + expected = grouped.agg(func_1, engine="numba") + with option_context("compute.use_numba", True): + result = grouped.agg(func_1, engine=None) + tm.assert_frame_equal(expected, result) diff --git a/pandas/tests/groupby/transform/test_numba.py b/pandas/tests/groupby/transform/test_numba.py index 9a4015ac983c5..ee482571e644d 100644 --- a/pandas/tests/groupby/transform/test_numba.py +++ b/pandas/tests/groupby/transform/test_numba.py @@ -3,7 +3,7 @@ from pandas.errors import NumbaUtilError import pandas.util._test_decorators as td -from pandas import DataFrame +from pandas import DataFrame, option_context import pandas._testing as tm from pandas.core.util.numba_ import NUMBA_FUNC_CACHE @@ -112,3 +112,18 @@ def func_2(values, index): result = grouped.transform(func_1, engine="numba", engine_kwargs=engine_kwargs) expected = grouped.transform(lambda x: x + 1, engine="cython") tm.assert_equal(result, expected) + + +@td.skip_if_no("numba", "0.46.0") +def test_use_global_config(): + def func_1(values, index): + return values + 1 + + data = DataFrame( + {0: ["a", "a", "b", "b", "a"], 1: [1.0, 2.0, 3.0, 4.0, 5.0]}, columns=[0, 1], + ) + grouped = data.groupby(0) + expected = grouped.transform(func_1, engine="numba") + with option_context("compute.use_numba", True): + result = grouped.transform(func_1, engine=None) + tm.assert_frame_equal(expected, result) diff --git a/pandas/tests/window/test_numba.py b/pandas/tests/window/test_numba.py index 7e049af0ca1f8..35bdb972a7bc0 100644 --- a/pandas/tests/window/test_numba.py +++ b/pandas/tests/window/test_numba.py @@ -3,7 +3,7 @@ import pandas.util._test_decorators as td -from pandas import Series +from pandas import Series, option_context import pandas._testing as tm from pandas.core.util.numba_ import NUMBA_FUNC_CACHE @@ -75,3 +75,15 @@ def func_2(x): ) expected = roll.apply(func_1, engine="cython", raw=True) tm.assert_series_equal(result, expected) + + +@td.skip_if_no("numba", "0.46.0") +def test_use_global_config(): + def f(x): + return np.mean(x) + 2 + + s = Series(range(10)) + with option_context("compute.use_numba", True): + result = s.rolling(2).apply(f, engine=None, raw=True) + expected = s.rolling(2).apply(f, engine="numba", raw=True) + tm.assert_series_equal(expected, result) From 3f518c571ae9c26f685bdbd58db533b2358c555d Mon Sep 17 00:00:00 2001 From: Matt Roeschke Date: Sat, 11 Jul 2020 21:14:13 -0700 Subject: [PATCH 5/8] Test ImportError if numba is not installed --- pandas/tests/util/test_numba.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 pandas/tests/util/test_numba.py diff --git a/pandas/tests/util/test_numba.py b/pandas/tests/util/test_numba.py new file mode 100644 index 0000000000000..27b68ff0f6044 --- /dev/null +++ b/pandas/tests/util/test_numba.py @@ -0,0 +1,12 @@ +import pytest + +import pandas.util._test_decorators as td + +from pandas import option_context + + +@td.skip_if_installed("numba") +def test_numba_not_installed_option_context(): + with pytest.raises(ImportError, match="Missing optional"): + with option_context("compute.use_numba", True): + pass From 97097ee7dde9915bf71b77fcc2051cd7565df8a9 Mon Sep 17 00:00:00 2001 From: Matt Roeschke Date: Sat, 11 Jul 2020 22:57:17 -0700 Subject: [PATCH 6/8] Add whatsnew --- doc/source/whatsnew/v1.1.0.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/source/whatsnew/v1.1.0.rst b/doc/source/whatsnew/v1.1.0.rst index 5f93e08d51baa..e8ad1e715004b 100644 --- a/doc/source/whatsnew/v1.1.0.rst +++ b/doc/source/whatsnew/v1.1.0.rst @@ -333,6 +333,7 @@ Other enhancements - :meth:`read_csv` now accepts string values like "0", "0.0", "1", "1.0" as convertible to the nullable boolean dtype (:issue:`34859`) - :class:`pandas.core.window.ExponentialMovingWindow` now supports a ``times`` argument that allows ``mean`` to be calculated with observations spaced by the timestamps in ``times`` (:issue:`34839`) - :meth:`DataFrame.agg` and :meth:`Series.agg` now accept named aggregation for renaming the output columns/indexes. (:issue:`26513`) +- ``compute.use_numba`` now exists as a configuration option that utilizes the numba engine when available (:issue:`33966`) .. --------------------------------------------------------------------------- From ba05d7574c1e479aef3a43b9aa6094dbda96dfb8 Mon Sep 17 00:00:00 2001 From: Matt Roeschke Date: Mon, 13 Jul 2020 21:41:23 -0700 Subject: [PATCH 7/8] Note the global config option --- pandas/core/groupby/groupby.py | 6 ++++-- pandas/core/window/rolling.py | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index c01b0b5553ed4..35f2d7cc8895f 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -290,7 +290,8 @@ class providing the base-class of operations. engine : str, default None * ``'cython'`` : Runs the function through C-extensions from cython. * ``'numba'`` : Runs the function through JIT compiled code from numba. - * ``None`` : Defaults to ``'cython'`` or global numba configuration. + * ``None`` : Defaults to ``'cython'`` or global numba configuration + (``'compute.use_numba`'`) .. versionadded:: 1.1.0 engine_kwargs : dict, default None @@ -398,7 +399,8 @@ class providing the base-class of operations. engine : str, default None * ``'cython'`` : Runs the function through C-extensions from cython. * ``'numba'`` : Runs the function through JIT compiled code from numba. - * ``None`` : Defaults to ``'cython'`` or global numba configuration. + * ``None`` : Defaults to ``'cython'`` or global numba configuration + (``'compute.use_numba`'`) .. versionadded:: 1.1.0 engine_kwargs : dict, default None diff --git a/pandas/core/window/rolling.py b/pandas/core/window/rolling.py index 80269ffabaa8a..9efcf4115d301 100644 --- a/pandas/core/window/rolling.py +++ b/pandas/core/window/rolling.py @@ -1302,7 +1302,8 @@ def count(self): * ``'cython'`` : Runs rolling apply through C-extensions from cython. * ``'numba'`` : Runs rolling apply through JIT compiled code from numba. Only available when ``raw`` is set to ``True``. - * ``None`` : Defaults to ``'cython'`` or global numba configuration. + * ``None`` : Defaults to ``'cython'`` or global numba configuration + (``'compute.use_numba`'`) .. versionadded:: 1.0.0 From 91fce8080c41c4b3270b1ab9e7f50046dfdfdb12 Mon Sep 17 00:00:00 2001 From: Matt Roeschke Date: Tue, 14 Jul 2020 09:25:38 -0700 Subject: [PATCH 8/8] Doc errors --- pandas/core/groupby/groupby.py | 6 ++---- pandas/core/window/rolling.py | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 35f2d7cc8895f..65483abbd2a6e 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -290,8 +290,7 @@ class providing the base-class of operations. engine : str, default None * ``'cython'`` : Runs the function through C-extensions from cython. * ``'numba'`` : Runs the function through JIT compiled code from numba. - * ``None`` : Defaults to ``'cython'`` or global numba configuration - (``'compute.use_numba`'`) + * ``None`` : Defaults to ``'cython'`` or globally setting ``compute.use_numba`` .. versionadded:: 1.1.0 engine_kwargs : dict, default None @@ -399,8 +398,7 @@ class providing the base-class of operations. engine : str, default None * ``'cython'`` : Runs the function through C-extensions from cython. * ``'numba'`` : Runs the function through JIT compiled code from numba. - * ``None`` : Defaults to ``'cython'`` or global numba configuration - (``'compute.use_numba`'`) + * ``None`` : Defaults to ``'cython'`` or globally setting ``compute.use_numba`` .. versionadded:: 1.1.0 engine_kwargs : dict, default None diff --git a/pandas/core/window/rolling.py b/pandas/core/window/rolling.py index 9efcf4115d301..48953f6a75487 100644 --- a/pandas/core/window/rolling.py +++ b/pandas/core/window/rolling.py @@ -1302,8 +1302,7 @@ def count(self): * ``'cython'`` : Runs rolling apply through C-extensions from cython. * ``'numba'`` : Runs rolling apply through JIT compiled code from numba. Only available when ``raw`` is set to ``True``. - * ``None`` : Defaults to ``'cython'`` or global numba configuration - (``'compute.use_numba`'`) + * ``None`` : Defaults to ``'cython'`` or globally setting ``compute.use_numba`` .. versionadded:: 1.0.0