我有一个根文件,这个根文件在Google drive上的这个link上可用,当我使用并行处理将它转换为根3中的数组时,它花费的时间和内存更少。我使用的代码类似于
from concurrent.futures import ThreadPoolExecutor
executor = ThreadPoolExecutor(8)
branches = pd.DataFrame.from_dict(uproot.open(''+file_with_path+'')[''+tree_name+''].arrays(namedecode='utf-8', executor = executor))
但现在它消耗了我在根4中的所有内存,可能是我没有正确地执行它。你能看一下吗?而且它也不像以前那么快了
from concurrent.futures import ThreadPoolExecutor
executor = ThreadPoolExecutor(8)
input_tree = uproot.open('/path/10k_events_PFSimplePlainTree.root:PlainTree', decompression_executor=executor)
branches = input_tree.arrays(library='pd', decompression_executor=executor)
@jpivarski和我在本link的问题上讨论了这一点,他建议这可能只是多了10%的内存,但对我来说这超过了10%。可能会增加60-80%
目前没有回答
相关问题 更多 >
编程相关推荐