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

Does #28827 also apply to applymap? #31620

Closed
MarcoGorelli opened this issue Feb 3, 2020 · 3 comments · Fixed by #34183
Closed

Does #28827 also apply to applymap? #31620

MarcoGorelli opened this issue Feb 3, 2020 · 3 comments · Fixed by #34183
Assignees
Milestone

Comments

@MarcoGorelli
Copy link
Member

MarcoGorelli commented Feb 3, 2020

In #28854, the note

In the current implementation applymap calls func twice on the first column/row to decide whether it can take a fast or slow code path. This can lead to unexpected behavior if func has side-effects, as they will take effect twice for the first column/row.

was removed from the DataFrame.apply docstring.

However, it is still in the docstring of DataFrame.applymap.

Does it need to be removed there too?

EDIT

As far as I can tell, this behaviour (calling the function twice to decide which path to take) still happens for groupby.apply and is what a user was asking about in #31111. Does it need to be documented in Groupby.Apply? Do end-users need to know about such internals?

@r0cketr1kky
Copy link
Contributor

r0cketr1kky commented Feb 5, 2020

I guess this should be removed from DataFrame.applymap as #31613 ensures a single index for fast and slow cases. I would love to take this up @MarcoGorelli

@MarcoGorelli
Copy link
Member Author

Sure, you can assign issues to yourself by commenting "take", see the following from the contributing guide:

When you start working on an issue, it’s a good idea to assign the issue to yourself, so nobody else duplicates the work on it. GitHub restricts assigning issues to maintainers of the project only. In most projects, and until recently in pandas, contributors added a comment letting others know they are working on an issue. While this is ok, you need to check each issue individually, and it’s not possible to find the unassigned ones.

For this reason, we implemented a workaround consisting of adding a comment with the exact text take. When you do it, a GitHub action will automatically assign you the issue (this will take seconds, and may require refreshint the page to see it). By doing this, it’s possible to filter the list of issues and find only the unassigned ones

@r0cketr1kky
Copy link
Contributor

take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment