We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
writelines
write
1 parent b5ecf48 commit 437b31eCopy full SHA for 437b31e
nibabel/cmdline/parrec2nii.py
@@ -358,8 +358,7 @@ def proc_file(infile, opts):
358
)
359
with open(basefilename + '.bvals', 'w') as fid:
360
# np.savetxt could do this, but it's just a loop anyway
361
- for val in bvals:
362
- fid.write(f'{val} ')
+ fid.writelines(f'{val} ' for val in bvals)
363
fid.write('\n')
364
else:
365
verbose('Writing .bvals and .bvecs files')
@@ -374,8 +373,7 @@ def proc_file(infile, opts):
374
373
375
with open(basefilename + '.bvecs', 'w') as fid:
376
for row in bvecs.T:
377
- for val in row:
378
+ fid.writelines(f'{val} ' for val in row)
379
380
381
# export data labels varying along the 4th dimensions if requested
0 commit comments