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 Encoder should accept categories having dtype='S' #19727
Conversation
- add dtype='S' cases to `test_encoders_string_categories` - add dtype arg to `_convert_container` to force dtype when applicable - `_convert_container` to list now converts container `[[1], [2]]` to requested dtype (e.g., `[[1.], [2.]]`)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR @andrewdelong !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Oh, actually we miss a second approval. @thomasjpfan do you want to have a new look at it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thank you for working on this @andrewdelong !
…9727) Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Reference Issues/PRs
Fixes #19677, which is a regression in how OneHotEncoder and OrdinalEncoder handle categories having dtype='S'.
What does this implement/fix? Explain your changes.
dtype.kind
checks from'OU'
to'OUS'
and updated the test.