Skip to content

Commit 3bcc5ed

Browse files
committed
use a more simple loop to build the multi-sites array (fix)
1 parent 59f40df commit 3bcc5ed

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

frites/dataset/ds_ephy.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,13 @@ def groupby(self, groupby="roi"):
302302
# increasing the number of trials
303303
n_sites = idx.sum()
304304
if n_sites != 1:
305-
__x = np.moveaxis(__x, 0, -1).reshape(self.n_times, -1)
306-
__yz = np.tile(__yz, (n_sites, 1))
305+
___x, ___yz = [], []
306+
for _ne in range(n_sites):
307+
___x += [__x[_ne, ...]]
308+
___yz += [__yz]
309+
__x = np.concatenate(___x, axis=1)
310+
__yz = np.concatenate(___yz, axis=0)
311+
del ___x, ___yz
307312
# at this point the data are (n_times, n_epochs)
308313
_x += [__x]
309314
_yz += [__yz]

0 commit comments

Comments
 (0)