Skip to content

Commit c593a70

Browse files
author
mdeboc
committed
DOC: update the pandas.DataFrame.apply docstring
1 parent 52db356 commit c593a70

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

pandas/core/frame.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4819,9 +4819,9 @@ def aggregate(self, func, axis=0, *args, **kwargs):
48194819
def apply(self, func, axis=0, broadcast=None, raw=False, reduce=None,
48204820
result_type=None, args=(), **kwds):
48214821
"""
4822-
Apply a function along an axis of the `Series`.
4822+
Apply a function along an axis of the DataFrame.
48234823
4824-
Objects passed to the function are `Series` objects having as index
4824+
Objects passed to the function are Series objects having as index
48254825
either the DataFrame's index (`axis=0`)
48264826
or the DataFrame's columns (`axis=1`).
48274827
If `result_type` is None, the final return type is the return
@@ -4840,7 +4840,7 @@ def apply(self, func, axis=0, broadcast=None, raw=False, reduce=None,
48404840
broadcast : boolean, optional
48414841
Only relevant for aggregation functions:
48424842
4843-
* `False` or `None` : returns a `Series` whose length is the length
4843+
* `False` or `None` : returns a Series whose length is the length
48444844
of the index or the number of columns (based on the `axis`
48454845
parameter)
48464846
* `True` : results will be broadcast to the original shape
@@ -4851,7 +4851,7 @@ def apply(self, func, axis=0, broadcast=None, raw=False, reduce=None,
48514851
by result_type='broadcast'.
48524852
48534853
raw : boolean, default False
4854-
* `False` : passes each row or column into a `Series` to the
4854+
* `False` : passes each row or column into a Series to the
48554855
function.
48564856
* `True` : the passed function will receive ndarray objects
48574857
instead.
@@ -4860,12 +4860,12 @@ def apply(self, func, axis=0, broadcast=None, raw=False, reduce=None,
48604860
reduce : boolean or None, default None
48614861
Try to apply reduction procedures. If the `DataFrame` is empty,
48624862
:meth:`apply` will use reduce to determine whether the result
4863-
should be a `Series` or a `DataFrame`. If reduce is None (the
4863+
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
4868+
If reduce is True a Series will always be returned, and if
48694869
`False` a `DataFrame` will always be returned.
48704870
48714871
.. deprecated:: 0.23.0.
@@ -4876,15 +4876,15 @@ def apply(self, func, axis=0, broadcast=None, raw=False, reduce=None,
48764876
These only act when `axis=1` (columns):
48774877
48784878
* 'expand' : list-like results will be turned into columns.
4879-
* 'reduce' : returns a `Series` if possible rather than expanding
4879+
* 'reduce' : returns a Series if possible rather than expanding
48804880
list-like results. This is the opposite of 'expand'.
48814881
* 'broadcast' : results will be broadcast to the original shape
48824882
of the `DataFrame`, the original index and columns will be
48834883
retained.
48844884
48854885
The default behaviour (`None`) depends on the return value of the
4886-
applied function: list-like results will be returned as a `Series`
4887-
of those. However if the apply function returns a `Series` these
4886+
applied function: list-like results will be returned as a Series
4887+
of those. However if the apply function returns a Series these
48884888
are expanded to columns.
48894889
48904890
.. versionadded:: 0.23.0.

0 commit comments

Comments
 (0)