We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
series name should be preserved in pser.mode()
1 parent f6a64d7 commit a8e80b0Copy full SHA for a8e80b0
pandas/tests/test_algos.py
@@ -2282,6 +2282,13 @@ def test_index(self):
2282
# algos.mode expects Arraylike, does *not* unwrap TimedeltaIndex
2283
algos.mode(idx)
2284
2285
+ def test_ser_mode_with_name(self):
2286
+ # GH 46737
2287
+ ser = Series([1, 1, 3], name="foo")
2288
+ result = ser.mode()
2289
+ expected = Series([1], name="foo")
2290
+ tm.assert_series_equal(result, expected)
2291
+
2292
2293
class TestDiff:
2294
@pytest.mark.parametrize("dtype", ["M8[ns]", "m8[ns]"])
0 commit comments