diff --git a/pandas/core/series.py b/pandas/core/series.py index 28827a014b244..fd89fe3ffec29 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -4776,6 +4776,15 @@ def map( 3 rabbit dtype: str + `map` can also be used for element-wise transformations with functions: + + >>> ser = pd.Series([1, 2, 3]) + >>> ser.map(lambda x: x + 1) + 0 2 + 1 3 + 2 4 + dtype: int64 + ``map`` accepts a ``dict`` or a ``Series``. Values that are not found in the ``dict`` are converted to ``NaN``, unless the dict has a default value (e.g. ``defaultdict``):