We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
df.map
lambda
1 parent a164271 commit 75d2750Copy full SHA for 75d2750
pandas/core/frame.py
@@ -10339,6 +10339,14 @@ def map(
10339
0 NaN 4
10340
1 5.0 5
10341
10342
+ It is also possible to use `map` with functions that are not
10343
+ `lambda` functions:
10344
+
10345
+ >>> df.map(round, ndigits=1)
10346
+ 0 1
10347
+ 0 1.0 2.1
10348
+ 1 3.4 4.6
10349
10350
Note that a vectorized version of `func` often exists, which will
10351
be much faster. You could square each number elementwise.
10352
0 commit comments