首页 > 解决方案 > MemoryError:无法为形状为 (108, 2260668) 且数据类型为 float64 的数组分配 1.82 GiB

问题描述

运行代码时:

loan_data = pd.concat([loan_data, loan_data_dummies], axis = 1)

我收到以下错误消息:

MemoryError: Unable to allocate 1.82 GiB for an array with shape (108, 2260668) and data type float64

我尝试了这些步骤:

    Windows 10

Press the Windows key
Type SystemPropertiesAdvanced
Click Run as administrator
Under Performance, click Settings
Select the Advanced tab
Select Change...
Uncheck Automatically managing paging file size for all drives
Then select Custom size and fill in the appropriate size
Press Set then press OK then exit from the Virtual Memory, Performance Options, and System Properties Dialog
Reboot your system

按照这里的说明;无法分配具有形状和数据类型的数组

我分配了 8000 MB 到驱动器 C 和 2000 到驱动器 D,不知道如何分配我的 11000 MB 内存以阻止错误发生?

标签: pythonpandaswindowsdataframeout-of-memory

解决方案


推荐阅读