diff --git a/doc/source/whatsnew/v0.18.0.txt b/doc/source/whatsnew/v0.18.0.txt index 6a8a4e7089ba3..ec002fae3b4b9 100644 --- a/doc/source/whatsnew/v0.18.0.txt +++ b/doc/source/whatsnew/v0.18.0.txt @@ -788,6 +788,7 @@ Removal of prior version deprecations/changes - Removal of the ``read_frame`` and ``frame_query`` (both aliases for ``pd.read_sql``) and ``write_frame`` (alias of ``to_sql``) functions in the ``pd.io.sql`` namespace, deprecated since 0.14.0 (:issue:`6292`). +- Removal of the ``order`` keyword from ``.factorize()`` (:issue:`6930`) .. _whatsnew_0180.performance: diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py index d516471ededb6..2c70da413bb8c 100644 --- a/pandas/core/algorithms.py +++ b/pandas/core/algorithms.py @@ -163,7 +163,6 @@ def factorize(values, sort=False, order=None, na_sentinel=-1, size_hint=None): Sequence sort : boolean, default False Sort by values - order : deprecated na_sentinel : int, default -1 Value to mark "not found" size_hint : hint to the hashtable sizer @@ -178,11 +177,6 @@ def factorize(values, sort=False, order=None, na_sentinel=-1, size_hint=None): note: an array of Periods will ignore sort as it returns an always sorted PeriodIndex """ - if order is not None: - msg = "order is deprecated. See " \ - "https://github.com/pydata/pandas/issues/6926" - warn(msg, FutureWarning, stacklevel=2) - from pandas import Index, Series, DatetimeIndex vals = np.asarray(values) diff --git a/pandas/tests/test_algos.py b/pandas/tests/test_algos.py index 13f1c4280ba38..957a9f1f808f1 100644 --- a/pandas/tests/test_algos.py +++ b/pandas/tests/test_algos.py @@ -53,12 +53,6 @@ def test_strings(self): class TestFactorize(tm.TestCase): _multiprocess_can_split_ = True - def test_warn(self): - - s = Series([1, 2, 3]) - with tm.assert_produces_warning(FutureWarning): - algos.factorize(s, order='A') - def test_basic(self): labels, uniques = algos.factorize(['a', 'b', 'b', 'a', 'a', 'c', 'c',