Skip to content

Commit

Permalink
small fix, changed map() to applymap() to apply to dataframes
Browse files Browse the repository at this point in the history
  • Loading branch information
anoushkajain committed Sep 17, 2024
1 parent e10fe69 commit 4104d21
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/spikeinterface/curation/model_based_curation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/spikeinterface/curation/train_manual_curation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 4104d21

Please sign in to comment.