-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
feat: add keep_column[s]
params to to_dummies
#14844
base: main
Are you sure you want to change the base?
Conversation
keep-column[s]
params to to_dummies
keep_column[s]
params to to_dummies
Unsure why code coverage failed, I added coverage tests. |
What happens if one of the new dummy columns has the same name as the original column? |
That would have to be very contrived. The dummy columns are named by import polars as pl
df = pl.DataFrame({
"a": [1, 2, 3],
"a_1": [1, 2, 3],
})
df.to_dummies("a")
My guess is that one can contrive many scenarios to collide with polars' renaming, but it's not in our best interest to fight those edge cases. |
As long as it raises the same error. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #14844 +/- ##
==========================================
+ Coverage 81.14% 81.19% +0.04%
==========================================
Files 1363 1367 +4
Lines 175282 175326 +44
Branches 2527 2527
==========================================
+ Hits 142236 142350 +114
+ Misses 32568 32496 -72
- Partials 478 480 +2 ☔ View full report in Codecov by Sentry. |
keep_column[s]
params to to_dummies
keep_column[s]
params to to_dummies
Resolves #14831.
Was fairly easy to implement so no harm if rejected. Not super happy about the different parameter names for Series and DataFrame, any suggested alternatives?
keep_original
would work but sounds ugly to me.