You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
API: change default behaviour of str.match from deprecated extract to match (GH5224)
This PR changes the default behaviour of
`str.match` from extracting groups to just a match (True/False). The
previous default behaviour was deprecated since 0.13.0
(#5224)
Author: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Closes#15257 from jorisvandenbossche/str-match and squashes the following commits:
0ab36b6 [Joris Van den Bossche] Raise FutureWarning instead of UserWarning for as_indexer
a2bae51 [Joris Van den Bossche] raise error in case of regex with groups and as_indexer=False
87446c3 [Joris Van den Bossche] fix test
0788de2 [Joris Van den Bossche] API: change default behaviour of str.match from deprecated extract to match (GH5224)
Copy file name to clipboardexpand all lines: doc/source/whatsnew/v0.20.0.txt
+7
Original file line number
Diff line number
Diff line change
@@ -761,6 +761,12 @@ Other API Changes
761
761
- ``Series.sort_values()`` accepts a one element list of bool for consistency with the behavior of ``DataFrame.sort_values()`` (:issue:`15604`)
762
762
- ``.merge()`` and ``.join()`` on ``category`` dtype columns will now preserve the category dtype when possible (:issue:`10409`)
763
763
- ``SparseDataFrame.default_fill_value`` will be 0, previously was ``nan`` in the return from ``pd.get_dummies(..., sparse=True)`` (:issue:`15594`)
764
+
- The default behaviour of ``Series.str.match`` has changed from extracting
765
+
groups to matching the pattern. The extracting behaviour was deprecated
766
+
since pandas version 0.13.0 and can be done with the ``Series.str.extract``
767
+
method (:issue:`5224`). As a consequence, the ``as_indexer`` keyword is
768
+
ignored (no longer needed to specify the new behaviour) and is deprecated.
769
+
764
770
765
771
.. _whatsnew_0200.deprecations:
766
772
@@ -777,6 +783,7 @@ Deprecations
777
783
- ``Series.sortlevel`` and ``DataFrame.sortlevel`` have been deprecated in favor of ``Series.sort_index`` and ``DataFrame.sort_index`` (:issue:`15099`)
778
784
- importing ``concat`` from ``pandas.tools.merge`` has been deprecated in favor of imports from the ``pandas`` namespace. This should only affect explict imports (:issue:`15358`)
779
785
- ``Series/DataFrame/Panel.consolidate()`` been deprecated as a public method. (:issue:`15483`)
786
+
- The ``as_indexer`` keyword of ``Series.str.match()`` has been deprecated (ignored keyword) (:issue:`15257`).
780
787
- The following top-level pandas functions have been deprecated and will be removed in a future version (:issue:`13790`)
781
788
* ``pd.pnow()``, replaced by ``Period.now()``
782
789
* ``pd.Term``, is removed, as it is not applicable to user code. Instead use in-line string expressions in the where clause when searching in HDFStore
0 commit comments