sklearn.utils.assert_all_finite

sklearn.utils.assert_all_finite(X, *, allow_nan=False)[source]

Throw a ValueError if X contains NaN or infinity.

Parameters
Xarray or sparse matrix
allow_nanbool