From 077b948a9726a2be51b6fe6713efb4f31b976c8e Mon Sep 17 00:00:00 2001 From: Nico Cernek Date: Sat, 26 Oct 2019 17:29:26 -0600 Subject: [PATCH] add before and after examples --- doc/source/whatsnew/v1.0.0.rst | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v1.0.0.rst b/doc/source/whatsnew/v1.0.0.rst index 90efcf74350d32..e6f54825e48bad 100644 --- a/doc/source/whatsnew/v1.0.0.rst +++ b/doc/source/whatsnew/v1.0.0.rst @@ -125,7 +125,6 @@ Backwards incompatible API changes - :class:`pandas.core.groupby.GroupBy.transform` now raises on invalid operation names (:issue:`27489`). - :class:`pandas.core.arrays.IntervalArray` adopts a new ``__repr__`` in accordance with other array classes (:issue:`25022`) -- :meth:`DataFrame.merge` now preserves right frame's row order when executing a right merge (:issue:`27453`) *pandas 0.25.x* @@ -144,6 +143,32 @@ Backwards incompatible API changes pd.arrays.IntervalArray.from_tuples([(0, 1), (2, 3)]) +- :meth:`DataFrame.merge` now preserves right frame's row order when executing a right merge (:issue:`27453`) + +.. ipython:: python + + left_df = pd.DataFrame({"colors": ["blue", "red"]}, index = pd.Index([0, 1])) + right_df = pd.DataFrame({"hats": ["small", "big"]}, index = pd.Index([1, 0])) + +*pandas 0.25.x* + +.. ipython:: python + left_df.merge(right_df, left_index=True, right_index=True, how="right") + colors hats + 0 blue big + 1 red small + + +*pandas 1.0.0* + +.. ipython:: python + + left_df.merge(right_df, left_index=True, right_index=True, how="right") + colors hats + 1 red small + 0 blue big + + .. _whatsnew_1000.api.other: