Skip to content

Commit 86283f3

Browse files
committed
DOC: Whatsnew for sorting mode result
1 parent b5d4e89 commit 86283f3

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

doc/source/whatsnew/v2.3.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Timezones
9595

9696
Numeric
9797
^^^^^^^
98-
-
98+
- Enabled :class:`Series.mode` and :class:`DataFrame.mode` with ``dropna=False`` to sort the result for all dtypes in the presence of NA values; previously only certain dtypes would sort (:issue:`60702`)
9999
-
100100

101101
Conversion

pandas/tests/reshape/test_pivot.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
import numpy as np
1010
import pytest
1111

12-
from pandas._config import using_string_dtype
13-
1412
from pandas.compat.numpy import np_version_gte1p25
1513

1614
import pandas as pd
@@ -2670,10 +2668,10 @@ def test_pivot_columns_not_given(self):
26702668

26712669
# this still fails because columns=None gets passed down to unstack as level=None
26722670
# while at that point None was converted to NaN
2673-
@pytest.mark.xfail(
2674-
using_string_dtype(), reason="TODO(infer_string) None is cast to NaN"
2675-
)
2676-
def test_pivot_columns_is_none(self):
2671+
# @pytest.mark.xfail(
2672+
# using_string_dtype(), reason="TODO(infer_string) None is cast to NaN"
2673+
# )
2674+
def test_pivot_columns_is_none(self, using_infer_string):
26772675
# GH#48293
26782676
df = DataFrame({None: [1], "b": 2, "c": 3})
26792677
result = df.pivot(columns=None)
@@ -2686,6 +2684,8 @@ def test_pivot_columns_is_none(self):
26862684

26872685
result = df.pivot(columns=None, index="b", values="c")
26882686
expected = DataFrame({1: 3}, index=Index([2], name="b"))
2687+
if using_infer_string:
2688+
expected.columns.name = np.nan
26892689
tm.assert_frame_equal(result, expected)
26902690

26912691
def test_pivot_index_is_none(self, using_infer_string):

0 commit comments

Comments
 (0)