Skip to content

Commit 025d304

Browse files
committed
DOC: Add mini example to whatsnew
1 parent 3367109 commit 025d304

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

doc/source/whatsnew/v1.1.0.rst

+7-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,13 @@ Missing
162162
MultiIndex
163163
^^^^^^^^^^
164164
- Bug in :meth:`Dataframe.loc` when used with a :class:`MultiIndex`. The returned values were not in the same order as the given inputs (:issue:`22797`)
165-
-
165+
166+
.. ipython:: python
167+
168+
df = pd.DataFrame(np.arange(4),
169+
index=[["a", "a", "b", "b"], [1, 2, 1, 2]])
170+
# Rows are now ordered as the requested keys
171+
df.loc[(['b', 'a'], [2, 1]), :]
166172
-
167173

168174
I/O

0 commit comments

Comments
 (0)