Skip to content

Commit 8376620

Browse files
committed
DOC: Warn about dtype inference with raw=True in DataFrame.apply
1 parent 1863adb commit 8376620

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
@@ -10629,6 +10629,13 @@ def apply(
1062910629
If you are just applying a NumPy reduction function this will
1063010630
achieve much better performance.
1063110631
10632+
.. warning::
10633+
10634+
When ``raw=True``, the output dtype is inferred from the
10635+
**first returned value**. If that value is not ``None``but
10636+
later calls return ``Nonw``, a ``TypeError`` may be raised
10637+
because Numpy infers a non-nullable dtype.
10638+
1063210639
result_type : {'expand', 'reduce', 'broadcast', None}, default None
1063310640
These only act when ``axis=1`` (columns):
1063410641

0 commit comments

Comments
 (0)