我在python3中有一个函数pre_raw()
和pandas data train_raw.values
我可以这样:
with concurrent.futures.ThreadPoolExecutor() as executor:
executor.map(pre_raw, train_raw.values)
如何在Python2上编写它?
感谢。
答案 0 :(得分:1)
procs=[]
for val in train_raw.values:
p = multiprocessing.Process(target=pre_raw, args=(val,))
procs.append(p)
p.start()
for p in procs:
p.join()