Commit 42ab11d1 authored by 张彦钊's avatar 张彦钊

modify multiFFMFormatPandas

parent 6cb6342a
......@@ -120,20 +120,11 @@ class multiFFMFormatPandas:
# 设置进程的数量
pool = Pool(processes)
print("总进度: " + str(len(data_list)))
result_map = {}
for i in range(len(data_list)):
data_list[i] = pool.apply_async(self.pool_function, (data_list[i], t,))
result_map.update(data_list[i].get())
result_map = {}
for i in data_list:
result_map.update(i.get())
'''
# 使用生成器方法计算,配合data_split_line的一起使用
result_map = {}
for i in data_list:
s = pool.apply_async(self.pool_function, (i, t,))
result_map.update(s.get())
'''
pool.close()
pool.join()
......@@ -141,7 +132,6 @@ class multiFFMFormatPandas:
# 多进程计算方法
def pool_function(self, df, t):
s = {idx: self.transform_row_(row, t) for idx, row in df.iterrows()}
return {idx: self.transform_row_(row, t) for idx, row in df.iterrows()}
# 切分数据方法,传人dataframe和切分条数的步长,返回dataframe的集合,每个dataframe中含有若干条数据
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment