Open
Changes from all commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Failed to load files.
Original file line numberDiff line numberDiff line change
Expand Up@@ -10378,6 +10378,7 @@ def apply(
----------
func : function
Function to apply to each column or row.

axis : {0 or 'index', 1 or 'columns'}, default 0
Axis along which the function is applied:

Expand All@@ -10398,6 +10399,13 @@ def apply(
These only act when ``axis=1`` (columns):

* 'expand' : list-like results will be turned into columns.
Note: The output type is inferred from the first function return value.
If the first return value is not list-like (e.g., None or NaN), expansion
will not occur, and the result may be a Series instead of a DataFrame.
To avoid inconsistent output types, ensure your function returns
consistent list-like objects (e.g., an empty dict {}) for missing or
NaN-like values.

* 'reduce' : returns a Series if possible rather than expanding
list-like results. This is the opposite of 'expand'.
* 'broadcast' : results will be broadcast to the original shape
Expand All@@ -10408,6 +10416,7 @@ def apply(
applied function: list-like results will be returned as a Series
of those. However if the apply function returns a Series these
are expanded to columns.

args : tuple
Positional arguments to pass to `func` in addition to the
array/series.
Expand Down
Loading