Skip to content

Commit c80bd19

Browse files
authored
DOC: remove warnings for .sort / .order deprecation removals (#15808)
1 parent 1058988 commit c80bd19

File tree

5 files changed

+19
-7
lines changed

5 files changed

+19
-7
lines changed

doc/source/whatsnew/v0.13.1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ API changes
125125
df = DataFrame({'col':['foo', 0, np.nan]})
126126
df2 = DataFrame({'col':[np.nan, 0, 'foo']}, index=[2,1,0])
127127
df.equals(df2)
128-
df.equals(df2.sort())
128+
df.equals(df2.sort_index())
129129

130130
import pandas.core.common as com
131131
com.array_equivalent(np.array([0, np.nan]), np.array([0, np.nan]))

doc/source/whatsnew/v0.15.0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ For full docs, see the :ref:`categorical introduction <categorical>` and the
8080
# Reorder the categories and simultaneously add the missing categories
8181
df["grade"] = df["grade"].cat.set_categories(["very bad", "bad", "medium", "good", "very good"])
8282
df["grade"]
83-
df.sort("grade")
83+
df.sort_values("grade")
8484
df.groupby("grade").size()
8585

8686
- ``pandas.core.group_agg`` and ``pandas.core.factor_agg`` were removed. As an alternative, construct

doc/source/whatsnew/v0.20.0.txt

+5
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ New features
3535

3636
The ``dtype`` keyword argument in the :func:`read_csv` function for specifying the types of parsed columns is now supported with the ``'python'`` engine (:issue:`14295`). See the :ref:`io docs <io.dtypes>` for more information.
3737

38+
.. ipython:: python
39+
:suppress:
40+
41+
from pandas.compat import StringIO
42+
3843
.. ipython:: python
3944

4045
data = "a,b\n1,2\n3,4"

doc/source/whatsnew/v0.7.3.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,4 @@ Series, to be more consistent with the ``groupby`` behavior with DataFrame:
9393
df
9494
grouped = df.groupby('A')['C']
9595
grouped.describe()
96-
grouped.apply(lambda x: x.order()[-2:]) # top 2 values
96+
grouped.apply(lambda x: x.sort_values()[-2:]) # top 2 values

doc/source/whatsnew/v0.9.1.txt

+11-4
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,20 @@ New features
2020
- `Series.sort`, `DataFrame.sort`, and `DataFrame.sort_index` can now be
2121
specified in a per-column manner to support multiple sort orders (:issue:`928`)
2222

23-
.. ipython:: python
24-
:okwarning:
23+
.. code-block:: ipython
2524

26-
df = DataFrame(np.random.randint(0, 2, (6, 3)), columns=['A', 'B', 'C'])
25+
In [2]: df = DataFrame(np.random.randint(0, 2, (6, 3)), columns=['A', 'B', 'C'])
2726

28-
df.sort(['A', 'B'], ascending=[1, 0])
27+
In [3]: df.sort(['A', 'B'], ascending=[1, 0])
2928

29+
Out[3]:
30+
A B C
31+
3 0 1 1
32+
4 0 1 1
33+
2 0 0 1
34+
0 1 0 0
35+
1 1 0 0
36+
5 1 0 0
3037

3138
- `DataFrame.rank` now supports additional argument values for the
3239
`na_option` parameter so missing values can be assigned either the largest

0 commit comments

Comments
 (0)