¡@

Home 

python Programming Glossary: finput

Combining itertools and multiprocessing?

http://stackoverflow.com/questions/7306522/combining-itertools-and-multiprocessing

import numpy as np from itertools import izip def myfunc finput # Do some calculations... ... # ... and return the result and.. # ... and return the result and the index return result finput 1 # Make indices inds np.rollaxis np.indices 256 256 256 0 4.. 3 # Make function input from the matrices and the indices finput izip matrices inds pool multiprocessing.Pool async_results np.asarray..