Skip to content

Commit 2828756

Browse files
committed
STY: Build hstack output as list comprehension
1 parent faa222a commit 2828756

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
@@ -162,10 +162,8 @@ def _list_outputs(self):
162162
else:
163163
out.append(value)
164164
else:
165-
for i in range(len(filename_to_list(values[0]))):
166-
out.insert(i, [])
167-
for value in values:
168-
out[i].append(filename_to_list(value)[i])
165+
lists = [filename_to_list(val) for val in values]
166+
out = [[val[i] for val in lists] for i in range(len(lists[0]))]
169167
if out:
170168
outputs['out'] = out
171169
return outputs

0 commit comments

Comments
 (0)