我收到了这个令人困惑的Python错误:
MemoryError: Unable to allocate array with shape (211, 6541) and data type <U67
首先,data type <U67
到底是什么?我在Google上找不到任何相关内容。
第二,如何为数组分配超过211行?我还有另外5000个左右的列表要追加。我本来不会在211 * 6451 * 8 = 10889288 bytes = 10.889288 megabytes
处占用太多空间,那么为什么添加更多空间会出现问题呢?即使我添加了所有列表,也仍然可以放心使用~270 megabytes
。
我的列表如下:
['text' 'more text' '1' '0' '0' ... '0' '1' '0']
这些被重复附加到数组中,如下所示:
array = numpy.append(array,[list],axis = 0)