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

Warning with pandas 2.2.0 and seaborn 0.13.1 kdeplot #3623

Closed
jhncls opened this issue Jan 25, 2024 · 2 comments
Closed

Warning with pandas 2.2.0 and seaborn 0.13.1 kdeplot #3623

jhncls opened this issue Jan 25, 2024 · 2 comments

Comments

@jhncls
Copy link

jhncls commented Jan 25, 2024

With seaborn 0.13.1 and pandas 2.2.0:

import seaborn as sns

tips = sns.load_dataset('tips')
sns.kdeplot(tips, x='tip', hue='day')

generates a warning:

...\seaborn\_base.py:949: FutureWarning: When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.
  data_subset = grouped_data.get_group(pd_key)

This can be mitigated by changing the code to data_subset = grouped_data.get_group((pd_key, )), as suggested in the message.

@mwaskom
Copy link
Owner

mwaskom commented Jan 25, 2024

Duplicate of #3618 and already addressed in master by #3620.

This can be mitigated by changing the code to data_subset = grouped_data.get_group((pd_key, )), as suggested in the message

You would think, except pandas does not support that on 1.x and requires the pd_key to be a singleton string. It's a truly ridiculous situation.

@mwaskom mwaskom closed this as not planned Won't fix, can't repro, duplicate, stale Jan 25, 2024
@mwaskom
Copy link
Owner

mwaskom commented Jan 25, 2024

I pushed out a 0.13.2 release this morning which should avoid these warnings (I don't see any in the test logs).

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

No branches or pull requests

2 participants