diff --git a/doc/source/whatsnew/v3.0.0.rst b/doc/source/whatsnew/v3.0.0.rst index 915b7744302c0..7e731462b1e67 100644 --- a/doc/source/whatsnew/v3.0.0.rst +++ b/doc/source/whatsnew/v3.0.0.rst @@ -157,9 +157,6 @@ Performance improvements Bug fixes ~~~~~~~~~ -- Fixed bug in :meth:`DataFrame.join` inconsistently setting result index name (:issue:`55815`) -- Fixed bug in :meth:`DataFrame.to_string` that raised ``StopIteration`` with nested DataFrames. (:issue:`16098`) -- Fixed bug in :meth:`Series.diff` allowing non-integer values for the ``periods`` argument. (:issue:`56607`) Categorical ^^^^^^^^^^^ @@ -188,9 +185,11 @@ Numeric Conversion ^^^^^^^^^^ +- Bug in :meth:`DataFrame.to_string` that raised ``StopIteration`` with nested DataFrames. (:issue:`16098`) - Bug in :meth:`Series.astype` might modify read-only array inplace when casting to a string dtype (:issue:`57212`) - Bug in :meth:`Series.reindex` not maintaining ``float32`` type when a ``reindex`` introduces a missing value (:issue:`45857`) + Strings ^^^^^^^ - Bug in :meth:`Series.value_counts` would not respect ``sort=False`` for series having ``string`` dtype (:issue:`55224`) @@ -243,8 +242,8 @@ Groupby/resample/rolling Reshaping ^^^^^^^^^ -- -- +- Bug in :meth:`DataFrame.join` inconsistently setting result index name (:issue:`55815`) +- Bug in :meth:`Index.join` where different :class:`Index` with different ``name`` s would not return an :class:`Index` with ``name=None`` (:issue:`57065`) Sparse ^^^^^^ @@ -265,6 +264,8 @@ Other ^^^^^ - Bug in :meth:`DataFrame.sort_index` when passing ``axis="columns"`` and ``ignore_index=True`` and ``ascending=False`` not returning a :class:`RangeIndex` columns (:issue:`57293`) - Bug in :meth:`DataFrame.where` where using a non-bool type array in the function would return a ``ValueError`` instead of a ``TypeError`` (:issue:`56330`) +- Bug in :meth:`Series.diff` allowing non-integer values for the ``periods`` argument. (:issue:`56607`) + .. ***DO NOT USE THIS SECTION*** diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index d9f545969d9f7..07286c0a92f94 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -4451,6 +4451,8 @@ def _join_non_unique( else: join_index = self.take(left_idx) + join_index.name = ops.get_op_result_name(self, other) + if how == "outer": mask = left_idx == -1 if mask.any(): diff --git a/pandas/tests/indexes/numeric/test_join.py b/pandas/tests/indexes/numeric/test_join.py index 4737af987a04e..7b065d894c686 100644 --- a/pandas/tests/indexes/numeric/test_join.py +++ b/pandas/tests/indexes/numeric/test_join.py @@ -366,3 +366,12 @@ def test_join_outer(self, index_large): tm.assert_index_equal(res, eres) tm.assert_numpy_array_equal(lidx, elidx) tm.assert_numpy_array_equal(ridx, eridx) + + +def test_join_differing_names_none(): + # GH 57065 + idx1 = Index([1, 1, 2, 3, 4, 4], name="a") + idx2 = Index([2, 5, 3, 4], name="b") + result = idx1.join(idx2) + expected = Index([1, 1, 2, 3, 4, 4]) + tm.assert_index_equal(result, expected)