Skip to content

Commit

Permalink
Address a couple of warnings that turned up only in the docs (#3500)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwaskom authored Sep 27, 2023
1 parent 6b9e2fb commit 782b71e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion doc/_docstrings/catplot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"source": [
"sns.catplot(\n",
" data=df, x=\"age\", y=\"class\", hue=\"sex\",\n",
" kind=\"violin\", bw=.25, cut=0, split=True,\n",
" kind=\"violin\", bw_adjust=.5, cut=0, split=True,\n",
")"
]
},
Expand Down
4 changes: 2 additions & 2 deletions seaborn/_core/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def agg(self, data: DataFrame, *args, **kwargs) -> DataFrame:

res = (
data
.groupby(grouper, sort=False, observed=True)
.groupby(grouper, sort=False, observed=False)
.agg(*args, **kwargs)
.reindex(groups)
.reset_index()
Expand All @@ -113,7 +113,7 @@ def apply(
return self._reorder_columns(func(data, *args, **kwargs), data)

parts = {}
for key, part_df in data.groupby(grouper, sort=False):
for key, part_df in data.groupby(grouper, sort=False, observed=False):
parts[key] = func(part_df, *args, **kwargs)
stack = []
for key in groups:
Expand Down
4 changes: 2 additions & 2 deletions seaborn/axisgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -1522,7 +1522,7 @@ def _map_diag_iter_hue(self, func, **kwargs):
fixed_color = kwargs.pop("color", None)

for var, ax in zip(self.diag_vars, self.diag_axes):
hue_grouped = self.data[var].groupby(self.hue_vals)
hue_grouped = self.data[var].groupby(self.hue_vals, observed=True)

plot_kwargs = kwargs.copy()
if str(func.__module__).startswith("seaborn"):
Expand Down Expand Up @@ -1629,7 +1629,7 @@ def _plot_bivariate_iter_hue(self, x_var, y_var, ax, func, **kwargs):
else:
axes_vars = [x_var, y_var]

hue_grouped = self.data.groupby(self.hue_vals)
hue_grouped = self.data.groupby(self.hue_vals, observed=True)
for k, label_k in enumerate(self._hue_order):

kws = kwargs.copy()
Expand Down

0 comments on commit 782b71e

Please sign in to comment.