Skip to content

Commit 7bb9174

Browse files
committed
DEPR: remove 'columns' kw from DataFrame.sort (prior deprecated circa 2012)
1 parent 9a15512 commit 7bb9174

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

doc/source/release.rst

+8
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,14 @@ API Changes
128128
- A tuple passed to ``DataFame.sort_index`` will be interpreted as the levels of
129129
the index, rather than requiring a list of tuple (:issue:`4370`)
130130

131+
Deprecations
132+
~~~~~~~~~~~~
133+
134+
Prior Version Deprecations/Changes
135+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
136+
137+
- Remove ``column`` keyword from ``DataFrame.sort`` (:issue:`4370`)
138+
131139
Experimental Features
132140
~~~~~~~~~~~~~~~~~~~~~
133141

doc/source/v0.14.0.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,9 @@ You can use a right-hand-side of an alignable object as well.
276276
Prior Version Deprecations/Changes
277277
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
278278

279-
There are no announced changes in 0.13.1 or prior that are taking effect as of 0.14.0
279+
Therse are prior version deprecations that are taking effect as of 0.14.0.
280+
281+
- Remove ``column`` keyword from ``DataFrame.sort`` (:issue:`4370`)
280282

281283
Deprecations
282284
~~~~~~~~~~~~

pandas/core/frame.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -2530,7 +2530,7 @@ def _m8_to_i8(x):
25302530
#----------------------------------------------------------------------
25312531
# Sorting
25322532

2533-
def sort(self, columns=None, column=None, axis=0, ascending=True,
2533+
def sort(self, columns=None, axis=0, ascending=True,
25342534
inplace=False):
25352535
"""
25362536
Sort DataFrame either by labels (along either axis) or by the values in
@@ -2539,8 +2539,9 @@ def sort(self, columns=None, column=None, axis=0, ascending=True,
25392539
Parameters
25402540
----------
25412541
columns : object
2542-
Column name(s) in frame. Accepts a column name or a list or tuple
2543-
for a nested sort.
2542+
Column name(s) in frame. Accepts a column name or a list
2543+
for a nested sort. A tuple will be interpreted as the
2544+
levels of a multi-index.
25442545
ascending : boolean or list, default True
25452546
Sort ascending vs. descending. Specify list for multiple sort
25462547
orders
@@ -2557,9 +2558,6 @@ def sort(self, columns=None, column=None, axis=0, ascending=True,
25572558
-------
25582559
sorted : DataFrame
25592560
"""
2560-
if column is not None: # pragma: no cover
2561-
warnings.warn("column is deprecated, use columns", FutureWarning)
2562-
columns = column
25632561
return self.sort_index(by=columns, axis=axis, ascending=ascending,
25642562
inplace=inplace)
25652563

0 commit comments

Comments
 (0)