Models will try to preprocess data by checking and handling missing values. This relies on calling numpy.isnan for numpy arrays, which won't work for arrays of strings or objects. The behavior of np.isnan can be expanded to handle these cases by relying on the spec that np.nan!=np.nan. We can implement a similar behavior by vectoring this as an elementwise operation
Models will try to preprocess data by checking and handling missing values. This relies on calling
numpy.isnan
for numpy arrays, which won't work for arrays of strings or objects. The behavior ofnp.isnan
can be expanded to handle these cases by relying on the spec thatnp.nan!=np.nan
. We can implement a similar behavior by vectoring this as an elementwise operation