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

Fix pandas groupby -> apply warning #555

Merged
merged 2 commits into from
Sep 18, 2024

Conversation

tomaarsen
Copy link
Member

Hello!

Pull Request overview

  • Fix pandas groupby -> apply warning

Details

Previously, this warning would trigger:

DeprecationWarning: DataFrameGroupBy.apply operated on the grouping columns. This behavior is deprecated, and in a future version of pandas the grouping columns will be excluded from the operation. Either pass `include_groups=False` to exclude the groupings or explicitly select the grouping columns after groupby to silence this warning.

Now, we use head to sample per group. Because the dataset is already shuffled, this is equivalent to using sample as we did before.

  • Tom Aarsen

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

We sample slightly different samples, so the training set metrics are obviously also different
@tomaarsen tomaarsen merged commit edee867 into huggingface:main Sep 18, 2024
22 checks passed
@tomaarsen tomaarsen deleted the warning/pandas_groupby_apply branch September 18, 2024 11:59
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.

2 participants