Skip to content

Commit 9c88205

Browse files
committed
STY: Build hstack output as list comprehension
1 parent 227fb9b commit 9c88205

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

nipype/interfaces/utility.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,8 @@ def _list_outputs(self):
164164
else:
165165
out.append(value)
166166
else:
167-
for i in range(len(filename_to_list(values[0]))):
168-
out.insert(i, [])
169-
for value in values:
170-
out[i].append(filename_to_list(value)[i])
167+
lists = [filename_to_list(val) for val in values]
168+
out = [[val[i] for val in lists] for i in range(len(lists[0]))]
171169
if out:
172170
outputs['out'] = out
173171
return outputs

0 commit comments

Comments
 (0)