def assert_all_finite(X):
    _assert_all_finite(X.data if sp.issparse(X) else X)
Throw a ValueError if X contains NaN or infinity.
dataset/ETHPy150Open trevorstephens/gplearn/gplearn/skutils/validation.py/assert_all_finite