Reputation: 2363
I am trying to pass arguments in to a function which is being mapped. Is there a way to clean this up or optimize?
# Map resized images
resized_imgs = tuple(map(resize_image, all_img_steps, [None for img in all_img_steps], [output_height for img in all_img_steps]))
Thanks!
Upvotes: 2
Views: 148
Reputation: 32954
Use a generator expression instead of a map.
resized_imgs = tuple(resize_image(img, None, output_height) for img in all_img_steps)
Upvotes: 5