Skip to content

Commit

Permalink
COMPAT: Change pandas use_inf_as_null to reflect 2.0 deprecation (#3177)
Browse files Browse the repository at this point in the history
  • Loading branch information
mroeschke committed Dec 6, 2022
1 parent ba786bc commit c8badb9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion seaborn/_core/plot.py
Expand Up @@ -1484,7 +1484,7 @@ def split_generator(keep_na=False) -> Generator:

axes_df = self._filter_subplot_data(df, view)

with pd.option_context("mode.use_inf_as_null", True):
with pd.option_context("mode.use_inf_as_na", True):
if keep_na:
# The simpler thing to do would be x.dropna().reindex(x.index).
# But that doesn't work with the way that the subset iteration
Expand Down
2 changes: 1 addition & 1 deletion seaborn/_oldcore.py
Expand Up @@ -1116,7 +1116,7 @@ def comp_data(self):
parts = []
grouped = self.plot_data[var].groupby(self.converters[var], sort=False)
for converter, orig in grouped:
with pd.option_context('mode.use_inf_as_null', True):
with pd.option_context('mode.use_inf_as_na', True):
orig = orig.dropna()
if var in self.var_levels:
# TODO this should happen in some centralized location
Expand Down
2 changes: 1 addition & 1 deletion seaborn/categorical.py
Expand Up @@ -1791,7 +1791,7 @@ def _lv_box_ends(self, vals):
vals = np.asarray(vals)
# Remove infinite values while handling a 'object' dtype
# that can come from pd.Float64Dtype() input
with pd.option_context('mode.use_inf_as_null', True):
with pd.option_context('mode.use_inf_as_na', True):
vals = vals[~pd.isnull(vals)]
n = len(vals)
p = self.outlier_prop
Expand Down

0 comments on commit c8badb9

Please sign in to comment.