Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: User Guide Page on user-defined functions #61195

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

arthurlw
Copy link
Contributor

@arthurlw
Copy link
Contributor Author

Currently writing this, so I would appreciate any feedback on it!

Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I'm not opposed to a dedicated page on UDFs, but I am opposed to duplicating documentation that exists elsewhere in the user guide, as I think much of this does. Instead of e.g. examples of apply, I recommend linking to the appropriate section. This page can then focus on recommendations of when to use apply vs other methods.

Comment on lines 16 to 17
Why Use User-Defined Functions?
-------------------------------
Copy link
Member

Choose a reason for hiding this comment

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

I think we should lead with Why _not_ User-Defined Functions. While performance is called out down below, I think the poor behavior of UDFs should be mentioned as well. Namely that pandas has no information on what a UDF is doing, and so has to infer (guess) at how to handle the result.

In particular, I think it should be mentioned that none of the examples on this page should be UDFs in practice.

@rhshadrach rhshadrach added Apply Apply, Aggregate, Transform, Map Docs labels Mar 29, 2025
@arthurlw
Copy link
Contributor Author

Hi @rhshadrach thanks for the feedback! I agree with you and will push updates soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Apply Apply, Aggregate, Transform, Map Docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: Write user guide page on apply/map/transform methods
2 participants