import threading
def thread_num(ss, num):
total = len(ss)
split_data = [ss[i: i + int(total/num)] for i in range(0, len(ss), int(total/num))]
for d in split_data:
t = threading.Thread(target=func, args=(d,))
t = t.start()
while threading.active_count()!=1:
pass
thread_num(ss, 100)

本文介绍了一种使用Python的threading模块进行多线程数据处理的方法,通过将数据集分割并分配给多个线程来并行处理,提高了数据处理效率。
4万+

被折叠的 条评论
为什么被折叠?



