我写了一个python代码来一行一行地平行填充数据帧,它工作得很好。我想知道,是否有可能在并行计算时显示进度条?
from multiprocessing import Pool
if __name__ == '__main__':
my_pool = Pool(10)
Data = pd.concat( my_pool.imap_unordered( parallelize_dataframe, range(0,len(dates)) ) )
my_pool.close()
from multiprocessing import Pool
from tqdm import tqdm
if __name__ == '__main__':
my_pool = Pool(10)
Data = pd.DataFrame()
for data in tqdm( my_pool.imap_unordered( parallelize_dataframe, range(0,len(dates)) ), total=len(dates)):
Data = pd.concat([Data , data]).sort_index()
my_pool.close()