在Python中增加最大数组大小

2024-04-25 11:32:16 发布

您现在位置:Python中文网/ 问答频道 /正文

我发送几个串行请求(get_docs函数),每个请求都返回一个200000个元素的数组。在

然后使用基本数组对其进行扩展,以便在一个数组中包含所有数据:

for iteration in range(0, int(es_request_count)):
  from_value = iteration * 200000
  docs = get_docs(from_value)
  external_ids.extend(docs)
  print "Total array length is " + str(len(external_ids))

当我得到5400000的数组大小时,进程被终止了。在

如何解决这个问题?我是否需要给进程更多的内存或者是否有办法增加最大数组大小?在


Tags: 数据函数infromids元素docsfor