We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 01d1479 + e3b2f16 commit 7ae08ccCopy full SHA for 7ae08cc
1 file changed
src/spikeinterface/core/sortinganalyzer.py
@@ -2092,6 +2092,13 @@ def load_data(self):
2092
import pandas as pd
2093
2094
ext_data = pd.read_csv(ext_data_file, index_col=0)
2095
+ # we need to cast the index to the unit id dtype (int or str)
2096
+ unit_ids = self.sorting_analyzer.unit_ids
2097
+ if ext_data.shape[0] == unit_ids.size:
2098
+ # we force dtype to be the same as unit_ids
2099
+ if ext_data.index.dtype != unit_ids.dtype:
2100
+ ext_data.index = ext_data.index.astype(unit_ids.dtype)
2101
+
2102
elif ext_data_file.suffix == ".pkl":
2103
with ext_data_file.open("rb") as f:
2104
ext_data = pickle.load(f)
0 commit comments