简体   繁体   English

无法为形状为 (129213603, 28) 且数据类型为 int8 的数组分配 3.37 GiB

[英]Unable to allocate 3.37 GiB for an array with shape (129213603, 28) and data type int8

if I run my python Code on Spyder, i get the above error code.如果我在 Spyder 上运行我的 python 代码,我会得到上述错误代码。 I have some pretty big lists, which I give into a multiindex我有一些非常大的列表,我将它们放入一个multiindex

4 list: 4 名单:

customer_list = []
for y in df_1['Sold-to SAP Cust No']:
    if y not in customer_list:
        customer_list.append(y)
        customer_list.sort()


df_c = pd.MultiIndex.from_product([
    customer_list,
    Material_list,
    Week_list,
    base_list],

The lists have about 200-300 entries.该列表有大约 200-300 个条目。

Does the error code mean that the lists are too big?错误代码是否意味着列表太大?

The issue is your attempting to allocate more memory than is available.问题是您尝试分配的 memory 比可用的多。

On Linux you can overcommit memory to a certain extent and on windows you can manage virtual memory.在 Linux 上,您可以在一定程度上过度使用 memory,在 windows 上,您可以管理虚拟 memory

Here is a link to a previous question on Stack Overflow that might be of some use.这是 Stack Overflow 上一个可能有用的问题的链接。 Unable to allocate array with shape and data type . 无法分配具有形状和数据类型的数组

There are also some really interesting articles out there about managing memory.还有一些关于管理 memory 的非常有趣的文章。 My honest suggestion would be to research ways to manipulate your data without putting it all in memory.我诚实的建议是研究处理数据的方法,而不是将其全部放入 memory。 You can store you data in a file or work with your data in a database.您可以将数据存储在文件中或使用数据库中的数据。 Here is an article which talks about large datasets, How to handle large datasets .这是一篇讨论大型数据集的文章, 如何处理大型数据集 The article is directed towards pandas, but the concepts are the same.文章针对的是pandas,但是概念是一样的。

You will benefit in the long run, especially if you attempt to run this program on different systems or work with larger datasets.从长远来看,您将受益,特别是如果您尝试在不同的系统上运行此程序或使用更大的数据集。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 MemoryError:无法为形状为 (5844379795,) 且数据类型为 int64 的数组分配 43.5 GiB - MemoryError: Unable to allocate 43.5 GiB for an array with shape (5844379795,) and data type int64 MemoryError:无法为形状为 (15500, 2, 240, 240, 1) 且数据类型为 int16 的数组分配 3.33 GiB - MemoryError: Unable to allocate 3.33 GiB for an array with shape (15500, 2, 240, 240, 1) and data type int16 无法为形状为 (27939587241,) 且数据类型为 int64 的数组分配 208.GiB? - Unable to allocate 208. GiB for an array with shape (27939587241,) and data type int64? Pandas 无法为形状 X 和数据类型 Y 的数组分配 GiB - Pandas unable to allocate GiB for an array with shape X and data type Y MemoryError: Unable to allocate 115. GiB for an array with shape (1122, 1122, 12288) and data type float64 - MemoryError: Unable to allocate 115. GiB for an array with shape (1122, 1122, 12288) and data type float64 MemoryError:无法为形状为 (323313, 3435) 且数据类型为 float64 的数组分配 8.27 GiB - MemoryError: Unable to allocate 8.27 GiB for an array with shape (323313, 3435) and data type float64 MemoryError:无法为形状为 (28709, 224, 224, 3) 且数据类型为 float64 的数组分配 32.2 GiB - MemoryError: Unable to allocate 32.2 GiB for an array with shape (28709, 224, 224, 3) and data type float64 MemoryError: 无法为形状 (2549150, 99) 和数据类型对象的数组分配 1.88 GiB - MemoryError: Unable to allocate 1.88 GiB for an array with shape (2549150, 99) and data type object 找到暗淡为 3 的数组。StandardScaler 预期 &lt;= 2,无法为形状为 (34997、244、244) 且数据类型为 float64 的数组分配 15.5 GiB - Found array with dim 3. StandardScaler expected <= 2,Unable to allocate 15.5 GiB for an array with shape (34997, 244, 244) and data type float64 Jupyter Notebook 错误:无法为形状(22370、389604)和数据类型 uint8 的数组分配 8.12 GiB(尝试更改 memory 但仍然失败) - Jupyter Notebook error: Unable to allocate 8.12 GiB for an array with shape (22370, 389604) and data type uint8 (tried changing memory but still fail)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM