-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
FunctionTransformer should not convert DataFrames to arrays by default #10655
Copy link
Copy link
Closed
Labels
EasyWell-defined and straightforward way to resolveWell-defined and straightforward way to resolve
Description
I would expect a common use of FunctionTransformer is to apply some function to a Pandas DataFrame, ideally using its own methods or accessors. As noted in #10648, it can be easy for users to miss that they need to set validate=False to pass through a DataFrame without converting it to a NumPy array. I think it would be more user-friendly to have validate='array-or-frame' by default, which would pass through DataFrames to the function, but otherwise convert its input to a 2d array. For strict backwards compatibility, the default should be changed through a deprecation cycle, warning whenever using the default validation means a DataFrame is currently converted to an array.
Do others agree?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
EasyWell-defined and straightforward way to resolveWell-defined and straightforward way to resolve