Skip to content

Commit 8251ada

Browse files
committed
DOC: Add mini example to whatsnew
1 parent 4b7c76d commit 8251ada

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
@@ -159,7 +159,13 @@ Missing
159159
MultiIndex
160160
^^^^^^^^^^
161161
- 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`)
162-
-
162+
163+
.. ipython:: python
164+
165+
df = pd.DataFrame(np.arange(4),
166+
index=[["a", "a", "b", "b"], [1, 2, 1, 2]])
167+
# Rows are now ordered as the requested keys
168+
df.loc[(['b', 'a'], [2, 1]), :]
163169
-
164170

165171
I/O

0 commit comments

Comments
 (0)