From 9f39d7b38c9d8a1b3bfea5246de1f41dec4acc92 Mon Sep 17 00:00:00 2001 From: Pakulin Sergei Date: Mon, 31 Jul 2023 14:00:29 +0300 Subject: [PATCH] inf condition simplification --- fedot/core/data/data_preprocessing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fedot/core/data/data_preprocessing.py b/fedot/core/data/data_preprocessing.py index 319d801870..aae5ed15dc 100644 --- a/fedot/core/data/data_preprocessing.py +++ b/fedot/core/data/data_preprocessing.py @@ -14,7 +14,7 @@ def data_type_is_suitable_for_preprocessing(data: InputData) -> bool: def replace_inf_with_nans(input_data: InputData): features = input_data.features - is_inf = (features == np.inf) | (features == -np.inf) + is_inf = np.isin(features, [np.inf, -np.inf]) if np.any(is_inf): features[is_inf] = np.nan