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

Add error to NullTransformer when data only contains nans #567

Merged
merged 1 commit into from
Oct 19, 2022

Conversation

fealho
Copy link
Member

@fealho fealho commented Oct 18, 2022

If data only has nans and missing_value_replacement is mean or mode, raise an error.

The previous behavior would return np.nan when it was set to mean, and return a KeyError when set to mode.

This change makes so transformers that don't support nans (e.g. ClusterBasedNormalizer) crash with a readable error, especially since missing_value_replacement is set to mean by default.

@fealho fealho marked this pull request as ready for review October 18, 2022 22:00
@fealho fealho requested a review from a team as a code owner October 18, 2022 22:01
@fealho fealho requested review from katxiao and amontanez24 and removed request for a team and katxiao October 18, 2022 22:01
@fealho fealho merged commit 257c972 into master Oct 19, 2022
@fealho fealho deleted the nulltransformer-error branch October 19, 2022 01:01
@amontanez24 amontanez24 added this to the 1.3.0 milestone Jan 18, 2023
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