in

Getting a error "ufunc ‘isnan’ not supported for the input types" when calling a previously fit scaler on a dataframe


ERROR: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

My dataframe is a mix of types, some string and some numeric.

I see that the string types come over as “object” which is normal.

My code works fine for some datasets but seems to be causing issues for others. I imputed any nulls and still get the same errors with no nulls in the dataset.

The only thing I am thinking is possible is if for some reason this subset of data results in a different set of dtypes than what was originally fit on.

Ex. if for a particular column, it is a mix of numbers and strings which in my program everything is just treated as string. If a subset of data is only numbers, that column will then be read as being numeric.

If this is the case, I wonder if there is a way to force all columns to the dtype of what they are expected to be in scaler. Ex. convert an numeric column to string.



Source: https://stackoverflow.com/questions/70603960/getting-a-error-ufunc-isnan-not-supported-for-the-input-types-when-calling-a

Incorrect IAM Policy Raised Questions About AWS Access to S3 Data

This 3-in-1 MagSafe VESA mount offers floating charging for iPhone, AirPods, and Apple Watch thumbnail

This 3-in-1 MagSafe VESA mount offers floating charging for iPhone, AirPods, and Apple Watch