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

Address inf_as_na pandas deprecation #3424

Merged
merged 6 commits into from
Aug 19, 2023

Conversation

mroeschke
Copy link
Contributor

seaborn/_base.py Outdated
# it is similar to GH2419, but more complicated because
# supporting `order` in categorical plots is tricky
orig = orig[orig.isin(self.var_levels[var])]
orig = orig.replace(np.inf, np.nan).dropna()
Copy link
Owner

Choose a reason for hiding this comment

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

What about negative inf?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call. Added -np.inf

@mwaskom
Copy link
Owner

mwaskom commented Aug 14, 2023

@mroeschke any idea why this is still failing? FWIW seaborn tests are now failing on the pandas rc as a result of the change so it would be good to sort this out.

@codecov
Copy link

codecov bot commented Aug 15, 2023

Codecov Report

Merging #3424 (f4d8ed5) into master (aebf7d8) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3424   +/-   ##
=======================================
  Coverage   98.32%   98.32%           
=======================================
  Files          77       77           
  Lines       24303    24305    +2     
=======================================
+ Hits        23897    23899    +2     
  Misses        406      406           
Files Changed Coverage Δ
seaborn/_base.py 97.54% <100.00%> (ø)
seaborn/_core/plot.py 98.26% <100.00%> (+<0.01%) ⬆️

@mroeschke
Copy link
Contributor Author

Okay got this to pass. I think the tested version of pandas (1.2) has a bug where replace with inf didn't work, but the mask solution here should be equivalent

@mwaskom
Copy link
Owner

mwaskom commented Aug 19, 2023

Nice!

@mwaskom mwaskom merged commit 2386036 into mwaskom:master Aug 19, 2023
@mroeschke mroeschke deleted the pandas/inf_as_na branch August 21, 2023 18:08
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