Skip to content

Commit

Permalink
DEPR: remove order kw from .factorize(), xref pandas-dev#6930
Browse files Browse the repository at this point in the history
  • Loading branch information
jreback committed Feb 10, 2016
1 parent 47f0222 commit 7584397
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
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

0 comments on commit 7584397

Please sign in to comment.