Skip to content

Commit cefd3a2

Browse files
committed
changed according to comments
1 parent c487676 commit cefd3a2

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

doc/source/user_guide/text.rst

+9
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,15 @@ Extracting substrings
364364
Extract first match in each subject (extract)
365365
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
366366

367+
.. warning::
368+
369+
Before version 0.23, argument ``expand`` of the ``extract`` method defaulted to
370+
``False``. When ``expand=False``, ``expand`` returns a ``Series``, ``Index``, or
371+
``DataFrame``, depending on the subject and regular expression
372+
pattern. When ``expand=True``, it always returns a ``DataFrame``,
373+
which is more consistent and less confusing from the perspective of a user.
374+
``expand=True`` has been the default since version 0.23.0.
375+
367376
The ``extract`` method accepts a `regular expression
368377
<https://docs.python.org/3/library/re.html>`__ with at least one
369378
capture group.

pandas/core/series.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -3593,12 +3593,16 @@ def nsmallest(self, n=5, keep="first"):
35933593

35943594
def swaplevel(self, i=-2, j=-1, copy=True):
35953595
"""
3596-
Swap levels i and j in a MultiIndex.
3596+
Swap levels i and j in a :class:`MultiIndex`.
3597+
3598+
Default is to swap the two innermost levels of the index.
35973599
35983600
Parameters
35993601
----------
36003602
i, j : int, str (can be mixed)
36013603
Level of index to be swapped. Can pass level name as string.
3604+
copy : bool, default True
3605+
Whether to copy underlying data.
36023606
36033607
Returns
36043608
-------

0 commit comments

Comments
 (0)