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(rust, python): Loosen restrictions on cut expressions and add docs #9730

Merged
merged 1 commit into from
Jul 6, 2023

Conversation

magarick
Copy link
Contributor

@magarick magarick commented Jul 5, 2023

The issue with qcut categoricals only manifests when explicit names aren't provided and the per-group labels are inconsistent. This allows qcut to be used in windows when labels are provided. It also removes the restriction on using cut in windows since the breaks will always be uniform which shouldn't trigger the bug. Finally, it adds some documentation and examples for the new functionality.

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Jul 5, 2023
// For now, we can't qcut over groups without creating consistent labels. The generated
// labels would be based on per-group quantiles, and per-group label differences caused
// problems when combining into a single categorical Series
let group_ok = labels.is_some();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeap, makes sense. 👍

@ritchie46 ritchie46 merged commit 2167cb1 into pola-rs:main Jul 6, 2023
@magarick magarick deleted the cut-restrictions-docs branch July 6, 2023 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants