Skip to content

Commit 7584397

Browse files
committed
DEPR: remove order kw from .factorize(), xref #6930
1 parent 47f0222 commit 7584397

File tree

3 files changed

+1
-12
lines changed

3 files changed

+1
-12
lines changed

doc/source/whatsnew/v0.18.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,7 @@ Removal of prior version deprecations/changes
787787
- Removal of the ``read_frame`` and ``frame_query`` (both aliases for ``pd.read_sql``)
788788
and ``write_frame`` (alias of ``to_sql``) functions in the ``pd.io.sql`` namespace,
789789
deprecated since 0.14.0 (:issue:`6292`).
790+
- Removal of the ``order`` keyword from ``.factorize()`` (:issue:`6930`)
790791

791792
.. _whatsnew_0180.performance:
792793

pandas/core/algorithms.py

-6
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ def factorize(values, sort=False, order=None, na_sentinel=-1, size_hint=None):
163163
Sequence
164164
sort : boolean, default False
165165
Sort by values
166-
order : deprecated
167166
na_sentinel : int, default -1
168167
Value to mark "not found"
169168
size_hint : hint to the hashtable sizer
@@ -178,11 +177,6 @@ def factorize(values, sort=False, order=None, na_sentinel=-1, size_hint=None):
178177
note: an array of Periods will ignore sort as it returns an always sorted
179178
PeriodIndex
180179
"""
181-
if order is not None:
182-
msg = "order is deprecated. See " \
183-
"https://github.com/pydata/pandas/issues/6926"
184-
warn(msg, FutureWarning, stacklevel=2)
185-
186180
from pandas import Index, Series, DatetimeIndex
187181

188182
vals = np.asarray(values)

pandas/tests/test_algos.py

-6
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,6 @@ def test_strings(self):
5353
class TestFactorize(tm.TestCase):
5454
_multiprocess_can_split_ = True
5555

56-
def test_warn(self):
57-
58-
s = Series([1, 2, 3])
59-
with tm.assert_produces_warning(FutureWarning):
60-
algos.factorize(s, order='A')
61-
6256
def test_basic(self):
6357

6458
labels, uniques = algos.factorize(['a', 'b', 'b', 'a', 'a', 'c', 'c',

0 commit comments

Comments
 (0)