Skip to content

Commit 0105edb

Browse files
author
mdeboc
committed
DOC: update the pandas.DataFrame.apply docstring
1 parent 3794d19 commit 0105edb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pandas/core/frame.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4859,18 +4859,18 @@ def apply(self, func, axis=0, broadcast=None, raw=False, reduce=None,
48594859
achieve much better performance.
48604860
reduce : bool or `None`, default `None`
48614861
Try to apply reduction procedures. If the `DataFrame` is empty,
4862-
:meth:`apply` will use reduce to determine whether the result
4862+
:meth:`apply` will use `reduce` to determine whether the result
48634863
should be a Series or a `DataFrame`. If ``reduce is None`` (the
48644864
default), :meth:`apply`'s return value will be guessed by calling
4865-
func on an empty Series
4865+
`func` on an empty Series
48664866
(note: while guessing, exceptions raised by `func` will be
48674867
ignored).
4868-
If reduce is True a Series will always be returned, and if
4869-
`False` a `DataFrame` will always be returned.
4868+
If ``reduce is True`` a Series will always be returned, and if
4869+
``reduce is False`` a `DataFrame` will always be returned.
48704870
48714871
.. deprecated:: 0.23.0.
48724872
This argument will be removed in a future version, replaced
4873-
by result_type='reduce'.
4873+
by ``result_type='reduce'``.
48744874
48754875
result_type : {'expand', 'reduce', 'broadcast', `None`}
48764876
These only act when ``axis=1`` (columns):
@@ -4898,9 +4898,9 @@ def apply(self, func, axis=0, broadcast=None, raw=False, reduce=None,
48984898
48994899
Notes
49004900
-----
4901-
In the current implementation apply calls func twice on the
4901+
In the current implementation apply calls `func` twice on the
49024902
first column/row to decide whether it can take a fast or slow
4903-
code path. This can lead to unexpected behavior if func has
4903+
code path. This can lead to unexpected behavior if `func` has
49044904
side-effects, as they will take effect twice for the first
49054905
column/row.
49064906

0 commit comments

Comments
 (0)