You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.
importnumpyasnpimportpandasaspdfromnimbusmlimportFileDataStreamfromnimbusml.preprocessing.missing_valuesimportHandler# 1 less than the maximum positive int32 value# See: https://docs.scipy.org/doc/numpy/user/basics.types.htmllarge_int=2147483646with_nans=pd.DataFrame(data=dict( c1=[3, large_int, 5, 4])).astype(np.int32)
nahandle=Handler(replace_with='Mean') <<'c1'result=nahandle.fit_transform(with_nans)
result=result.astype(np.int32)
print(result)
print(result.dtypes)
print(result.loc[1, 'c1.c1'])
print(result.loc[1, 'c1.c1'] ==large_int)
The last line prints False and the value returned is -2147483648.
This does work if the number is small enough to accurately fit in a float32 (ie. large_int = 21474836).
This looks like it fails because the Handler transform implicitly converts its inputs in to float32. Any values which cannot be represented by float32 will not work correctly with this transform.
The text was updated successfully, but these errors were encountered:
The last line prints
False
and the value returned is -2147483648.This does work if the number is small enough to accurately fit in a float32 (ie.
large_int = 21474836
).This looks like it fails because the Handler transform implicitly converts its inputs in to float32. Any values which cannot be represented by float32 will not work correctly with this transform.
The text was updated successfully, but these errors were encountered: