diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 3edfea4480e47..1630c2c31920d 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -10339,6 +10339,14 @@ def map( 0 NaN 4 1 5.0 5 + It is also possible to use `map` with functions that are not + `lambda` functions: + + >>> df.map(round, ndigits=1) + 0 1 + 0 1.0 2.1 + 1 3.4 4.6 + Note that a vectorized version of `func` often exists, which will be much faster. You could square each number elementwise.