Skip to content

Decouple df.head() from the Cramer's computation #1179

Open
@glemaitre

Description

I got kind of surprise when I did the following display

import skrub
from sklearn.datasets import fetch_california_housing

skrub.patch_display()
X, y = fetch_california_housing(return_X_y=True, as_frame=True)
X.head()

image

It took some time to understand that the reason was due to the X.head() and that in this case, it was making sense.

I'm wondering if you should avoid computing all the different values when one call X.head() instead of showing the statistics on few line. It can be misleading.

An alternative is to compute the statistics on the full dataset instead even if a user request to check the .head(). However if you call .head() it might be only because you are interested of seeing the couple of first line of the dataframe without checking any other statistics.

@jeromedockes WDYT?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions