diff --git a/src/spikeinterface/curation/model_based_curation.py b/src/spikeinterface/curation/model_based_curation.py index 87b5693034..ebc12458cc 100644 --- a/src/spikeinterface/curation/model_based_curation.py +++ b/src/spikeinterface/curation/model_based_curation.py @@ -93,7 +93,7 @@ def predict_labels(self, label_conversion=None, input_data=None, export_to_phy=F warnings.warn("Could not find `label_conversion` key in `model_info.json` file") # Prepare input data - input_data = input_data.map(lambda x: np.nan if np.isinf(x) else x) + input_data = input_data.applymap(lambda x: np.nan if np.isinf(x) else x) input_data = input_data.astype("float32") # Apply classifier diff --git a/src/spikeinterface/curation/train_manual_curation.py b/src/spikeinterface/curation/train_manual_curation.py index e905aa7646..6223fd1c4c 100644 --- a/src/spikeinterface/curation/train_manual_curation.py +++ b/src/spikeinterface/curation/train_manual_curation.py @@ -225,8 +225,8 @@ def process_test_data_for_classification(self): print("metrics_list contains invalid metric names") raise e self.X = self.testing_metrics.reindex(columns=self.metric_names) + self.X = self.X.applymap(lambda x: np.nan if np.isinf(x) else x) self.X = self.X.astype("float32") - self.X = self.X.map(lambda x: np.nan if np.isinf(x) else x) self.X.fillna(0, inplace=True) def apply_scaling_imputation(self, imputation_strategy, scaling_technique, X_train, X_val, y_train, y_val):