Skip to content

Commit b515ac2

Browse files
committed
STY: Build hstack output as list comprehension
1 parent 73f93a2 commit b515ac2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

nipype/interfaces/utility/base.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,8 @@ def _list_outputs(self):
156156
else:
157157
out.append(value)
158158
else:
159-
for i in range(len(filename_to_list(values[0]))):
160-
out.insert(i, [])
161-
for value in values:
162-
out[i].append(filename_to_list(value)[i])
159+
lists = [filename_to_list(val) for val in values]
160+
out = [[val[i] for val in lists] for i in range(len(lists[0]))]
163161
if out:
164162
outputs['out'] = out
165163
return outputs

0 commit comments

Comments
 (0)