Skip to content

Commit dc6c36c

Browse files
committed
FIX: Specify dtype object when making arrays from list that might contain lists
1 parent d02750a commit dc6c36c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nipype/interfaces/utility/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def _list_outputs(self):
362362
splits.extend(self.inputs.splits)
363363
splits = np.cumsum(splits)
364364
for i in range(len(splits) - 1):
365-
val = np.array(self.inputs.inlist)[splits[i] : splits[i + 1]].tolist()
365+
val = np.array(self.inputs.inlist, dtype=object)[splits[i] : splits[i + 1]].tolist()
366366
if self.inputs.squeeze and len(val) == 1:
367367
val = val[0]
368368
outputs["out%d" % (i + 1)] = val
@@ -407,7 +407,7 @@ class Select(IOBase):
407407

408408
def _list_outputs(self):
409409
outputs = self._outputs().get()
410-
out = np.array(self.inputs.inlist)[np.array(self.inputs.index)].tolist()
410+
out = np.array(self.inputs.inlist, dtype=object)[np.array(self.inputs.index)].tolist()
411411
outputs["out"] = out
412412
return outputs
413413

0 commit comments

Comments
 (0)