計算の時間を短縮するために、次の投稿で、concurrent.futures で map を使用するように誰かに言われました。しかし、結果を読み取ることができません。
import concurrent.futures
import numpy
def f(num):
return num * 2
arr = numpy.array(
[numpy.array([
numpy.array([1,2,3]),
numpy.array([4,5,6]),
numpy.array([7,8,9])]),
numpy.array([
numpy.array([1,2,3]),
numpy.array([4,5,6]),
numpy.array([7,8,9])])])
with concurrent.futures.ProcessPoolExecutor() as exc:
print(exc.map(f, arr))