Skip to content

Warning with pandas 2.2.0 and seaborn 0.13.1 kdeplot #3623

@jhncls

Description

@jhncls

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions