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
When given a callable, :meth:`Series.map` applies the callable to all elements of the ``Series``.
28
-
Similarly, :meth:`DataFrame.applymap` applies the callable to all elements of the ``DataFrame``,
28
+
Similarly, :meth:`DataFrame.map` applies the callable to all elements of the ``DataFrame``,
29
29
while :meth:`Index.map` applies the callable to all elements of the ``Index``.
30
30
31
31
Frequently, it is not desirable to apply the callable to nan-like values of the array and to avoid doing
@@ -59,10 +59,12 @@ and whether ``na_action="ignore"`` worked with a specific data type was quite un
59
59
ser = pd.Series(["a", "b", np.nan], dtype="category")
60
60
ser.map(str.upper, na_action="ignore")
61
61
df = pd.DataFrame(ser)
62
-
df.applymap(str.upper, na_action="ignore")
62
+
df.map(str.upper, na_action="ignore")
63
63
idx = pd.Index(ser)
64
64
idx.map(str.upper, na_action="ignore")
65
65
66
+
Notice also that :meth:`DataFrame.applymap` in this version has been renamed to :meth:`DataFrame.map` (:issue:`52353`).
67
+
66
68
.. _whatsnew_210.enhancements.other:
67
69
68
70
Other enhancements
@@ -166,6 +168,7 @@ Deprecations
166
168
- Deprecated logical operations (``|``, ``&``, ``^``) between pandas objects and dtype-less sequences (e.g. ``list``, ``tuple``), wrap a sequence in a :class:`Series` or numpy array before operating instead (:issue:`51521`)
167
169
- Deprecated :meth:`DataFrame.swapaxes` and :meth:`Series.swapaxes`, use :meth:`DataFrame.transpose` or :meth:`Series.transpose` instead (:issue:`51946`)
168
170
- Deprecated parameter ``convert_type`` in :meth:`Series.apply` (:issue:`52140`)
171
+
- Deprecated :meth:`DataFrame.applymap`. Use the new :meth:`DataFrame.map` method instead (:issue:`52353`)
0 commit comments