Skip to content

Commit

Permalink
DOC: Whatsnew for sorting mode result
Browse files Browse the repository at this point in the history
  • Loading branch information
rhshadrach committed Jan 14, 2025
1 parent b5d4e89 commit 86283f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v2.3.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Timezones

Numeric
^^^^^^^
-
- 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`)
-

Conversion
Expand Down
12 changes: 6 additions & 6 deletions pandas/tests/reshape/test_pivot.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import numpy as np
import pytest

from pandas._config import using_string_dtype

from pandas.compat.numpy import np_version_gte1p25

import pandas as pd
Expand Down Expand Up @@ -2670,10 +2668,10 @@ def test_pivot_columns_not_given(self):

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

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

def test_pivot_index_is_none(self, using_infer_string):
Expand Down

0 comments on commit 86283f3

Please sign in to comment.