Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pandas for openSUSE:Factory checked in at 2025-07-15 16:42:43 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pandas (Old) and /work/SRC/openSUSE:Factory/.python-pandas.new.7373 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pandas" Tue Jul 15 16:42:43 2025 rev:77 rq:1292272 version:2.3.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pandas/python-pandas.changes 2025-03-21 20:21:43.777030991 +0100 +++ /work/SRC/openSUSE:Factory/.python-pandas.new.7373/python-pandas.changes 2025-07-15 16:43:24.334866474 +0200 @@ -1,0 +2,91 @@ +Fri Jul 11 19:29:45 UTC 2025 - Ben Greiner <c...@bnavigator.de> + +- Update to 2.3.1 + * This release includes some improvements and fixes to the future + string data type (preview feature for the upcoming pandas 3.0) + ## Improvements and fixes for the StringDtype + * Comparisons between different string dtypes + * Index set operations ignore empty RangeIndex and object dtype + Index + ## Bug fixes + * Bug in DataFrameGroupBy.min(), DataFrameGroupBy.max(), + Resampler.min(), Resampler.max() where all NA values of string + dtype would return float instead of string dtype (GH 60810) + * Bug in DataFrame.join() incorrectly downcasting object-dtype + indexes (GH 61771) + * Bug in DataFrame.sum() with axis=1, DataFrameGroupBy.sum() or + SeriesGroupBy.sum() with skipna=True, and Resampler.sum() with + all NA values of StringDtype resulted in 0 instead of the empty + string "" (GH 60229) + * Fixed bug in DataFrame.explode() and Series.explode() where + methods would fail with dtype="str" (GH 61623) + * Fixed bug in unpickling objects pickled in pandas versions + pre-2.3.0 that used StringDtype (GH 61763) +- Release 2.3.0 + ## Enhancements + * The semantics for the copy keyword in __array__ methods (i.e. + called when using np.array() or np.asarray() on pandas objects) + has been updated to work correctly with NumPy >= 2 (GH 57739) + * Series.str.decode() result now has StringDtype when + future.infer_string is True (GH 60709) + * to_hdf() and to_hdf() now round-trip with StringDtype (GH + 60663) + * Improved repr of NumpyExtensionArray to account for NEP51 (GH + 61085) + * The Series.str.decode() has gained the argument dtype to + control the dtype of the result (GH 60940) + * The cumsum(), cummin(), and cummax() reductions are now + implemented for StringDtype columns (GH 60633) + * The sum() reduction is now implemented for StringDtype columns + (GH 59853) + ## Deprecations + * Deprecated allowing non-bool values for na in str.contains(), + str.startswith(), and str.endswith() for dtypes that do not + already disallow these (GH 59615) + * Deprecated the "pyarrow_numpy" storage option for StringDtype + (GH 60152) + * The deprecation of setting the argument include_groups to True + in DataFrameGroupBy.apply() has been promoted from a + DeprecationWarning to FutureWarning; only False will be allowed + (GH 7155) + ## Bug fixes + ### Numeric + * Bug in Series.mode() and DataFrame.mode() with dropna=False + where not all dtypes would sort in the presence of NA values + (GH 60702) + * Bug in Series.round() where a TypeError would always raise with + object dtype (GH 61206) + ### Strings + * Bug in Series.__pos__() and DataFrame.__pos__() where an + Exception was not raised for StringDtype with storage="pyarrow" + (GH 60710) + * Bug in Series.rank() for StringDtype with storage="pyarrow" + that incorrectly returned integer results with method="average" + and raised an error if it would truncate results (GH 59768) + * Bug in Series.replace() with StringDtype when replacing with a + non-string value was not upcasting to object dtype (GH 60282) + * Bug in Series.str.center() with StringDtype with + storage="pyarrow" not matching the python behavior in corner + cases with an odd number of fill characters (GH 54792) + * Bug in Series.str.replace() when n < 0 for StringDtype with + storage="pyarrow" (GH 59628) + * Bug in Series.str.slice() with negative step with ArrowDtype + and StringDtype with storage="pyarrow" giving incorrect results + (GH 59710) + ### Indexing + Bug in Index.get_indexer() round-tripping through string dtype + when infer_string is enabled (GH 55834) + ### I/O + * Bug in DataFrame.to_excel() which stored decimals as strings + instead of numbers (GH 49598) + ### Other + * Fixed usage of inspect when the optional dependencies pyarrow + or jinja2 are not installed (GH 60196) +- Drop patches: + * timedelta.patch + * pandas-pr60545-arrow-exception.patch + * pandas-pr60584-60586-mpl-vert.patch +- Refresh dropna.patch to pandas-pr61132-dropna.patch + * gh#pandas-dev/pandas#61132 + +------------------------------------------------------------------- Old: ---- dropna.patch pandas-2.2.3.tar.gz pandas-pr60545-arrow-exception.patch pandas-pr60584-60586-mpl-vert.patch timedelta.patch New: ---- pandas-2.3.1.tar.gz pandas-pr61132-dropna.patch ----------(Old B)---------- Old: * pandas-pr60584-60586-mpl-vert.patch - Refresh dropna.patch to pandas-pr61132-dropna.patch * gh#pandas-dev/pandas#61132 Old: * timedelta.patch * pandas-pr60545-arrow-exception.patch * pandas-pr60584-60586-mpl-vert.patch Old: * pandas-pr60545-arrow-exception.patch * pandas-pr60584-60586-mpl-vert.patch - Refresh dropna.patch to pandas-pr61132-dropna.patch Old:- Drop patches: * timedelta.patch * pandas-pr60545-arrow-exception.patch ----------(Old E)---------- ----------(New B)---------- New: * pandas-pr60584-60586-mpl-vert.patch - Refresh dropna.patch to pandas-pr61132-dropna.patch * gh#pandas-dev/pandas#61132 ----------(New E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pandas.spec ++++++ --- /var/tmp/diff_new_pack.VQ58Kt/_old 2025-07-15 16:43:27.918999766 +0200 +++ /var/tmp/diff_new_pack.VQ58Kt/_new 2025-07-15 16:43:27.935000362 +0200 @@ -37,7 +37,7 @@ %if "%{flavor}" != "test-py313" %define skip_python313 1 %endif -# Skip empty buildsets, last one is for sle15_python_module_pythons +# Skip empty buildsets on tumbleweed or flavors other than python311 on leap with sle15_python_module_pythons %if "%{shrink:%{pythons}}" == "" || ("%pythons" == "python311" && 0%{?skip_python311}) ExclusiveArch: donotbuild %define python_module() %flavor-not-enabled-in-buildset-for-suse-%{?suse_version} @@ -64,7 +64,7 @@ %endif Name: python-pandas%{psuffix} # Set version through _service -Version: 2.2.3 +Version: 2.3.1 Release: 0 Summary: Python data structures for data analysis, time series, and statistics License: BSD-3-Clause @@ -72,14 +72,8 @@ # SourceRepository: https://github.com/pandas-dev/pandas # Must be created by cloning through `osc service runall`: gh#pandas-dev/pandas#54903, gh#pandas-dev/pandas#54907 Source0: pandas-%{version}.tar.gz -# PATCH-FIX-UPSTREAM pandas-pr60545-arrow-exception.patch gh#pandas-dev/pandas#60545 -Patch0: https://github.com/pandas-dev/pandas/pull/60545.patch#/pandas-pr60545-arrow-exception.patch -# PATCH-FIX-UPSTREAM pandas-pr60584-60586-mpl-vert.patch gh#pandas-dev/pandas#60584 gh#pandas-dev/pandas#60586 -Patch1: https://github.com/pandas-dev/pandas/pull/60586.patch#/pandas-pr60584-60586-mpl-vert.patch -# PATCH-FIX-UPSTREAM https://github.com/pandas-dev/pandas/pull/61132 BUG: .mode(dropna=False) doesn't work with nullable integers -Patch2: dropna.patch -# PATCH-FIX-UPSTREAM https://github.com/pandas-dev/pandas/pull/60416 TST: Avoid hashing np.timedelta64 without unit -Patch3: timedelta.patch +# PATCH-FIX-UPSTREAM pandas-pr61132-dropna.patch gh#pandas-dev/pandas#61132 BUG: .mode(dropna=False) doesn't work with nullable integers +Patch1: pandas-pr61132-dropna.patch %if !%{with test} BuildRequires: %{python_module Cython >= 3.0.5} BuildRequires: %{python_module devel >= 3.9} @@ -91,7 +85,7 @@ BuildRequires: fdupes BuildRequires: gcc%{?gccver}-c++ BuildRequires: git-core -BuildRequires: meson >= 1.2.1 +BuildRequires: (meson >= 1.2.1 with meson < 2) %endif BuildRequires: python-rpm-macros Requires: python-python-dateutil >= 2.8.2 @@ -518,21 +512,15 @@ # expects a dirty git revision from git repo SKIP_TESTS+=" or test_git_version" # https://github.com/pandas-dev/pandas/pull/57391, proposed change is not necessarily the right one -%if "%{flavor}" == "test-py312" +%if "%{flavor}" == "test-py312" || "%{flavor}" == "test-py313" SKIP_TESTS+=" or (test_scalar_unary and numexpr-pandas)" %endif -%if "%{flavor}" == "test-py313" -SKIP_TESTS+=" or (test_scalar_unary and numexpr-pandas)" -%endif -# https://github.com/pandas-dev/pandas/pull/55901, not gonna merge this huge patch to fix one test failing with new timezone, will be included in new release +# https://github.com/pandas-dev/pandas/pull/55901, not gonna merge this huge patch to fix one test failing with new timezone, will be included in 3.0 SKIP_TESTS+=" or test_array_inference[data7-expected7]" -# numpy 2.1 issues? -SKIP_TESTS+=" or test_frame_setitem_dask_array_into_new_col" # too new xarray, gh#pandas-dev/pandas#60109 backport too much SKIP_TESTS+=" or (TestDataFrameToXArray and test_to_xarray_index_types)" -# too new pyarrow, gh#pandas-dev/pandas#60755 backport too much -SKIP_TESTS+=" or (TestParquetPyArrow and test_roundtrip_decimal)" - +# xpass strict: our xarray seems to handle this fine +SKIP_TESTS+=" or (TestSeriesToXArray and test_to_xarray_index_types)" %ifarch %{ix86} %{arm32} # https://github.com/pandas-dev/pandas/issues/31856 SKIP_TESTS+=" or test_maybe_promote_int_with_int" ++++++ _service ++++++ --- /var/tmp/diff_new_pack.VQ58Kt/_old 2025-07-15 16:43:28.247011965 +0200 +++ /var/tmp/diff_new_pack.VQ58Kt/_new 2025-07-15 16:43:28.279013156 +0200 @@ -2,7 +2,7 @@ <service name="tar_scm" mode="disabled"> <param name="url">https://github.com/pandas-dev/pandas.git</param> <param name="scm">git</param> - <param name="revision">v2.2.3</param> + <param name="revision">v2.3.1</param> <param name="versionformat">@PARENT_TAG@</param> <param name="versionrewrite-pattern">v(.*)</param> <param name="filename">pandas</param> ++++++ pandas-2.2.3.tar.gz -> pandas-2.3.1.tar.gz ++++++ /work/SRC/openSUSE:Factory/python-pandas/pandas-2.2.3.tar.gz /work/SRC/openSUSE:Factory/.python-pandas.new.7373/pandas-2.3.1.tar.gz differ: char 12, line 1 ++++++ pandas-pr61132-dropna.patch ++++++ >From 1e899afbd9ca20f4ce9d6f93e1f62c072be0ed23 Mon Sep 17 00:00:00 2001 From: Gen Sato <52241300+haloge...@users.noreply.github.com> Date: Tue, 18 Mar 2025 01:33:40 +0900 Subject: [PATCH] BUG: .mode(dropna=False) doesn't work with nullable integers (#61132) * Fix dropna bug when mode * Fix test cases * Fix data type incompatible --- doc/source/whatsnew/v3.0.0.rst | 1 + pandas/_libs/hashtable_func_helper.pxi.in | 2 +- pandas/core/algorithms.py | 12 +++--- pandas/core/arrays/base.py | 5 ++- pandas/core/arrays/categorical.py | 2 +- pandas/core/arrays/datetimelike.py | 2 +- pandas/core/arrays/masked.py | 8 +--- pandas/core/series.py | 2 +- pandas/tests/series/test_reductions.py | 23 +++++++++++ pandas/tests/test_algos.py | 47 +++++++++++++++-------- 10 files changed, 71 insertions(+), 33 deletions(-) Index: pandas-2.3.1/pandas/_libs/hashtable_func_helper.pxi.in =================================================================== --- pandas-2.3.1.orig/pandas/_libs/hashtable_func_helper.pxi.in +++ pandas-2.3.1/pandas/_libs/hashtable_func_helper.pxi.in @@ -443,7 +443,7 @@ def mode(ndarray[htfunc_t] values, bint if na_counter > 0: res_mask = np.zeros(j+1, dtype=np.bool_) - res_mask[j] = True + res_mask[j] = (na_counter == max_count) return modes[:j + 1], res_mask Index: pandas-2.3.1/pandas/core/algorithms.py =================================================================== --- pandas-2.3.1.orig/pandas/core/algorithms.py +++ pandas-2.3.1/pandas/core/algorithms.py @@ -1022,7 +1022,7 @@ def duplicated( def mode( values: ArrayLike, dropna: bool = True, mask: npt.NDArray[np.bool_] | None = None -) -> ArrayLike: +) -> tuple[np.ndarray, npt.NDArray[np.bool_]] | ExtensionArray: """ Returns the mode(s) of an array. @@ -1035,7 +1035,7 @@ def mode( Returns ------- - np.ndarray or ExtensionArray + Union[Tuple[np.ndarray, npt.NDArray[np.bool_]], ExtensionArray] """ values = _ensure_arraylike(values, func_name="mode") original = values @@ -1049,8 +1049,10 @@ def mode( values = _ensure_data(values) npresult, res_mask = htable.mode(values, dropna=dropna, mask=mask) - if res_mask is not None: - return npresult, res_mask # type: ignore[return-value] + if res_mask is None: + res_mask = np.zeros(npresult.shape, dtype=np.bool_) + else: + return npresult, res_mask try: npresult = safe_sort(npresult) @@ -1061,7 +1063,7 @@ def mode( ) result = _reconstruct_data(npresult, original.dtype, original) - return result + return result, res_mask def rank( Index: pandas-2.3.1/pandas/core/arrays/base.py =================================================================== --- pandas-2.3.1.orig/pandas/core/arrays/base.py +++ pandas-2.3.1/pandas/core/arrays/base.py @@ -2270,8 +2270,9 @@ class ExtensionArray: Sorted, if possible. """ # error: Incompatible return value type (got "Union[ExtensionArray, - # ndarray[Any, Any]]", expected "Self") - return mode(self, dropna=dropna) # type: ignore[return-value] + # Tuple[np.ndarray, npt.NDArray[np.bool_]]", expected "Self") + result, _ = mode(self, dropna=dropna) + return result # type: ignore[return-value] def __array_ufunc__(self, ufunc: np.ufunc, method: str, *inputs, **kwargs): if any( Index: pandas-2.3.1/pandas/core/arrays/categorical.py =================================================================== --- pandas-2.3.1.orig/pandas/core/arrays/categorical.py +++ pandas-2.3.1/pandas/core/arrays/categorical.py @@ -2459,7 +2459,7 @@ class Categorical(NDArrayBackedExtension if dropna: mask = self.isna() - res_codes = algorithms.mode(codes, mask=mask) + res_codes, _ = algorithms.mode(codes, mask=mask) res_codes = cast(np.ndarray, res_codes) assert res_codes.dtype == codes.dtype res = self._from_backing_data(res_codes) Index: pandas-2.3.1/pandas/core/arrays/datetimelike.py =================================================================== --- pandas-2.3.1.orig/pandas/core/arrays/datetimelike.py +++ pandas-2.3.1/pandas/core/arrays/datetimelike.py @@ -1669,7 +1669,7 @@ class DatetimeLikeArrayMixin( # type: i if dropna: mask = self.isna() - i8modes = algorithms.mode(self.view("i8"), mask=mask) + i8modes, _ = algorithms.mode(self.view("i8"), mask=mask) npmodes = i8modes.view(self._ndarray.dtype) npmodes = cast(np.ndarray, npmodes) return self._from_backing_data(npmodes) Index: pandas-2.3.1/pandas/core/arrays/masked.py =================================================================== --- pandas-2.3.1.orig/pandas/core/arrays/masked.py +++ pandas-2.3.1/pandas/core/arrays/masked.py @@ -1124,12 +1124,8 @@ class BaseMaskedArray(OpsMixin, Extensio return Series(arr, index=index, name="count", copy=False) def _mode(self, dropna: bool = True) -> Self: - if dropna: - result = mode(self._data, dropna=dropna, mask=self._mask) - res_mask = np.zeros(result.shape, dtype=np.bool_) - else: - result, res_mask = mode(self._data, dropna=dropna, mask=self._mask) - result = type(self)(result, res_mask) # type: ignore[arg-type] + result, res_mask = mode(self._data, dropna=dropna, mask=self._mask) + result = type(self)(result, res_mask) return result[result.argsort()] @doc(ExtensionArray.equals) Index: pandas-2.3.1/pandas/core/series.py =================================================================== --- pandas-2.3.1.orig/pandas/core/series.py +++ pandas-2.3.1/pandas/core/series.py @@ -2337,7 +2337,7 @@ class Series(base.IndexOpsMixin, NDFrame # TODO: Add option for bins like value_counts() values = self._values if isinstance(values, np.ndarray): - res_values = algorithms.mode(values, dropna=dropna) + res_values, _ = algorithms.mode(values, dropna=dropna) else: res_values = values._mode(dropna=dropna) Index: pandas-2.3.1/pandas/tests/series/test_reductions.py =================================================================== --- pandas-2.3.1.orig/pandas/tests/series/test_reductions.py +++ pandas-2.3.1/pandas/tests/series/test_reductions.py @@ -51,6 +51,29 @@ def test_mode_nullable_dtype(any_numeric tm.assert_series_equal(result, expected) +def test_mode_nullable_dtype_edge_case(any_numeric_ea_dtype): + # GH##58926 + ser = Series([1, 2, 3, 1], dtype=any_numeric_ea_dtype) + result = ser.mode(dropna=False) + expected = Series([1], dtype=any_numeric_ea_dtype) + tm.assert_series_equal(result, expected) + + ser2 = Series([1, 1, 2, 3, pd.NA], dtype=any_numeric_ea_dtype) + result = ser2.mode(dropna=False) + expected = Series([1], dtype=any_numeric_ea_dtype) + tm.assert_series_equal(result, expected) + + ser3 = Series([1, pd.NA, pd.NA], dtype=any_numeric_ea_dtype) + result = ser3.mode(dropna=False) + expected = Series([pd.NA], dtype=any_numeric_ea_dtype) + tm.assert_series_equal(result, expected) + + ser4 = Series([1, 1, pd.NA, pd.NA], dtype=any_numeric_ea_dtype) + result = ser4.mode(dropna=False) + expected = Series([1, pd.NA], dtype=any_numeric_ea_dtype) + tm.assert_series_equal(result, expected) + + def test_mode_infer_string(): # GH#56183 pytest.importorskip("pyarrow") Index: pandas-2.3.1/pandas/tests/test_algos.py =================================================================== --- pandas-2.3.1.orig/pandas/tests/test_algos.py +++ pandas-2.3.1/pandas/tests/test_algos.py @@ -1855,7 +1855,8 @@ class TestRank: class TestMode: def test_no_mode(self): exp = Series([], dtype=np.float64, index=Index([], dtype=int)) - tm.assert_numpy_array_equal(algos.mode(np.array([])), exp.values) + result, _ = algos.mode(np.array([])) + tm.assert_numpy_array_equal(result, exp.values) @pytest.mark.parametrize("dt", np.typecodes["AllInteger"] + np.typecodes["Float"]) def test_mode_single(self, dt): @@ -1868,20 +1869,24 @@ class TestMode: ser = Series(data_single, dtype=dt) exp = Series(exp_single, dtype=dt) - tm.assert_numpy_array_equal(algos.mode(ser.values), exp.values) + result, _ = algos.mode(ser.values) + tm.assert_numpy_array_equal(result, exp.values) tm.assert_series_equal(ser.mode(), exp) ser = Series(data_multi, dtype=dt) exp = Series(exp_multi, dtype=dt) - tm.assert_numpy_array_equal(algos.mode(ser.values), exp.values) + result, _ = algos.mode(ser.values) + tm.assert_numpy_array_equal(result, exp.values) tm.assert_series_equal(ser.mode(), exp) def test_mode_obj_int(self): exp = Series([1], dtype=int) - tm.assert_numpy_array_equal(algos.mode(exp.values), exp.values) + result, _ = algos.mode(exp.values) + tm.assert_numpy_array_equal(result, exp.values) exp = Series(["a", "b", "c"], dtype=object) - tm.assert_numpy_array_equal(algos.mode(exp.values), exp.values) + result, _ = algos.mode(exp.values) + tm.assert_numpy_array_equal(result, exp.values) @pytest.mark.parametrize("dt", np.typecodes["AllInteger"] + np.typecodes["Float"]) def test_number_mode(self, dt): @@ -1893,12 +1898,14 @@ class TestMode: ser = Series(data_single, dtype=dt) exp = Series(exp_single, dtype=dt) - tm.assert_numpy_array_equal(algos.mode(ser.values), exp.values) + result, _ = algos.mode(ser.values) + tm.assert_numpy_array_equal(result, exp.values) tm.assert_series_equal(ser.mode(), exp) ser = Series(data_multi, dtype=dt) exp = Series(exp_multi, dtype=dt) - tm.assert_numpy_array_equal(algos.mode(ser.values), exp.values) + result, _ = algos.mode(ser.values) + tm.assert_numpy_array_equal(result, exp.values) tm.assert_series_equal(ser.mode(), exp) def test_strobj_mode(self): @@ -1907,7 +1914,8 @@ class TestMode: ser = Series(data, dtype="c") exp = Series(exp, dtype="c") - tm.assert_numpy_array_equal(algos.mode(ser.values), exp.values) + result, _ = algos.mode(ser.values) + tm.assert_numpy_array_equal(result, exp.values) tm.assert_series_equal(ser.mode(), exp) @pytest.mark.parametrize("dt", [str, object]) @@ -1920,7 +1928,8 @@ class TestMode: if using_infer_string and dt is str: tm.assert_extension_array_equal(algos.mode(ser.values), exp.values) else: - tm.assert_numpy_array_equal(algos.mode(ser.values), exp.values) + result, _ = algos.mode(ser.values) + tm.assert_numpy_array_equal(result, exp.values) tm.assert_series_equal(ser.mode(), exp) def test_datelike_mode(self): @@ -1954,18 +1963,21 @@ class TestMode: def test_mixed_dtype(self): exp = Series(["foo"], dtype=object) ser = Series([1, "foo", "foo"]) - tm.assert_numpy_array_equal(algos.mode(ser.values), exp.values) + result, _ = algos.mode(ser.values) + tm.assert_numpy_array_equal(result, exp.values) tm.assert_series_equal(ser.mode(), exp) def test_uint64_overflow(self): exp = Series([2**63], dtype=np.uint64) ser = Series([1, 2**63, 2**63], dtype=np.uint64) - tm.assert_numpy_array_equal(algos.mode(ser.values), exp.values) + result, _ = algos.mode(ser.values) + tm.assert_numpy_array_equal(result, exp.values) tm.assert_series_equal(ser.mode(), exp) exp = Series([1, 2**63], dtype=np.uint64) ser = Series([1, 2**63], dtype=np.uint64) - tm.assert_numpy_array_equal(algos.mode(ser.values), exp.values) + result, _ = algos.mode(ser.values) + tm.assert_numpy_array_equal(result, exp.values) tm.assert_series_equal(ser.mode(), exp) def test_categorical(self): @@ -1987,15 +1999,18 @@ class TestMode: def test_index(self): idx = Index([1, 2, 3]) exp = Series([1, 2, 3], dtype=np.int64) - tm.assert_numpy_array_equal(algos.mode(idx), exp.values) + result, _ = algos.mode(idx) + tm.assert_numpy_array_equal(result, exp.values) idx = Index([1, "a", "a"]) exp = Series(["a"], dtype=object) - tm.assert_numpy_array_equal(algos.mode(idx), exp.values) + result, _ = algos.mode(idx) + tm.assert_numpy_array_equal(result, exp.values) idx = Index([1, 1, 2, 3, 3]) exp = Series([1, 3], dtype=np.int64) - tm.assert_numpy_array_equal(algos.mode(idx), exp.values) + result, _ = algos.mode(idx) + tm.assert_numpy_array_equal(result, exp.values) idx = Index( ["1 day", "1 day", "-1 day", "-1 day 2 min", "2 min", "2 min"],