Skip to content

pairplot: check whether data supports dataframe API #3857

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

smathot
Copy link

@smathot smathot commented Jun 19, 2025

Currently, pairplot(), unlike other plotting functions, requires that the data is a pd.DataFrame. This prevents the function from working with objects that are fully compatible with DataFrame, but are of a different class. By changing the check to requiring the presence of a __dataframe__ attribute, this is resolved.

The patch relies on the DataFrame interoperability protocol (which is a fancy of saying that it checks the existence of a __dataframe__() function) as well as the soft-standard of the __array__() function for array-like objects.

For me, the main reason to submit this PR is to make seaborn fully compatible with DataMatrix 2.0. (Right now, pairplot() is the only plot still failing.)

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.

1 participant