Skip to content

Conversation

pranavkp71
Copy link

@pranavkp71
Copy link
Author

This PR adds a note to the DataFrame.apply docstring to warn users about dtype inference when using raw=True, addressing issue #61632.

Comment on lines +10560 to +10562
returned value. If that value is not ``None`` but later calls return
``None``, a ``TypeError`` may occur because NumPy infers a
non-nullable dtype.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
returned value. If that value is not ``None`` but later calls return
``None``, a ``TypeError`` may occur because NumPy infers a
non-nullable dtype.
returned value.

Let's just keep it simple

If you are just applying a NumPy reduction function this will
achieve much better performance.
.. warning::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. warning::
.. note::

@mroeschke mroeschke added the Docs label Oct 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: warn about apply with raw=True, if function returns Optional[int]
2 participants