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

Replace applymap with map #226

Closed

Conversation

GuyPago
Copy link

@GuyPago GuyPago commented May 9, 2024

Previously, map was used for Series class while applymap was used for the DataFrame class. Now Pandas has deprecated applymap and suggest using map for DataFrame as well.

image

@timkpaine
Copy link
Collaborator

This doesn't work on pandas<2.

@GuyPago
Copy link
Author

GuyPago commented May 9, 2024

Good comment. I guess requiring >=2.0 from >=0.19 is a pretty major demand, isn't it? Even though the code itself supports 2.2+.

@timkpaine
Copy link
Collaborator

Correct, we're not going to require >=2 so the best bet would be to check if pandas > 2/2.1 like we do here and swap the behavior you want to use.

@GuyPago
Copy link
Author

GuyPago commented May 9, 2024

Considering the fact that applymap is deprecated rather than removed, it feels like an overkill.
If you beg the differ, I'll integrate the change you proposed. Waiting for your response.

@timkpaine
Copy link
Collaborator

I made, and then reverted, this same change in #224. So I wasn't really keen to do the work just to avoid a deprecation warning.

@timkpaine timkpaine closed this Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants