Skip to content

DEPR: remove order kw from .factorize(), xref #6930 #12274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/source/whatsnew/v0.18.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,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:

Expand Down
6 changes: 0 additions & 6 deletions pandas/core/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
6 changes: 0 additions & 6 deletions pandas/tests/test_algos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down