Skip to content

Commit 9d1ac2f

Browse files
committed
update
1 parent 5276b11 commit 9d1ac2f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

web/pandas/pdeps/0013-standardize-apply.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,10 @@ It can also be noted that `Series.apply` & `DataFrame.apply` could almost always
109109
| lambda x: str(x) | .map | .map |
110110
| lambda x: x + 1 | .transform | .transform |
111111
| [lambda x: x.sum()] | .agg | .agg |
112-
``
113112

114-
Because of their flexibility, `Series.apply` & `DataFrame.apply` are considered unnecessarily complex, and it would be better to direct users to use `.map`, `.agg` or `.transform`, as appropriate in the given situation.
113+
So, for example, `ser.apply(lambda x: str(x))` can be replaced with `ser.map(lambda x: str(x))` while `df.apply([lambda x: x.sum()])` can be replaced with `df.agg([lambda x: x.sum()])`.
114+
115+
Overall, because of their flexibility, `Series.apply` & `DataFrame.apply` are considered unnecessarily complex, and it would be clearer for users to use `.map`, `.agg` or `.transform`, as appropriate in the given situation.
115116

116117
## Proposal
117118

0 commit comments

Comments
 (0)