Skip to content

Commit

Permalink
FIX NDVar.__setitem__: boolean index
Browse files Browse the repository at this point in the history
  • Loading branch information
christianbrodbeck committed Jun 12, 2021
1 parent 928eb3c commit 748a3ed
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion eelbrain/_data_obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -3511,7 +3511,10 @@ def __setitem__(self, key, value):
index = self._array_index(key)
if isinstance(value, NDVar):
value = self._ialign(value, index)
self.x[index] = value
if isinstance(index, np.ndarray) and index.dtype.kind == 'i':
self.x[index] = value.ravel()
else:
self.x[index] = value

def __len__(self):
return len(self.x)
Expand Down

0 comments on commit 748a3ed

Please sign in to comment.