Skip to content

Commit 1970f9e

Browse files
committed
DOC: Warn about dtype inference with raw=True in DataFrame.apply
1 parent 10a5305 commit 1970f9e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/core/frame.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10554,6 +10554,13 @@ def apply(
1055410554
If you are just applying a NumPy reduction function this will
1055510555
achieve much better performance.
1055610556
10557+
.. warning::
10558+
10559+
When ``raw=True``, the output dtype is inferred from the
10560+
**first returned value**. If that value is not ``None``but
10561+
later calls return ``Nonw``, a ``TypeError`` may be raised
10562+
because Numpy infers a non-nullable dtype.
10563+
1055710564
result_type : {'expand', 'reduce', 'broadcast', None}, default None
1055810565
These only act when ``axis=1`` (columns):
1055910566

0 commit comments

Comments
 (0)