Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Pandas 大内存机器上的内存错误,但小内存机器上的内存错误:相同的代码,相同的数据_Pandas - Fatal编程技术网

Pandas 大内存机器上的内存错误,但小内存机器上的内存错误:相同的代码,相同的数据

Pandas 大内存机器上的内存错误,但小内存机器上的内存错误:相同的代码,相同的数据,pandas,Pandas,我在我的两台机器上运行以下操作: 导入操作系统,sqlite3 作为pd进口熊猫 从feat_transform导入筛选器_anevexp db_path=r'C:\Users\timregan\Desktop\anondb_280718.sqlite3' db=sqlite3.connect(db_路径) anevexp\u df=过滤器\u anevexp(db,0) 在我的笔记本电脑上(有8GB的RAM),运行起来没有问题(尽管调用filter\u anevexp需要几分钟)。在我的桌面

我在我的两台机器上运行以下操作:

导入操作系统,sqlite3 作为pd进口熊猫 从feat_transform导入筛选器_anevexp db_path=r'C:\Users\timregan\Desktop\anondb_280718.sqlite3' db=sqlite3.connect(db_路径) anevexp\u df=过滤器\u anevexp(db,0) 在我的笔记本电脑上(有8GB的RAM),运行起来没有问题(尽管调用
filter\u anevexp
需要几分钟)。在我的桌面(128GB内存)上,由于内存错误,无法正常工作:

回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“C:\Users\timregan\source\MentalHealth\code\preprocessing\feat\u transform.py”,第171行,在filter\u anevexp中
anevexp_df=anevexp_df[anevexp_df[“用户id”].isin(df)].copy()
文件“C:\Users\timregan\AppData\Local\Programs\Python\Python37-32\lib\site packages\pandas\core\frame.py”,第2682行,在u getitem中__
返回self.\u getitem\u数组(键)
文件“C:\Users\timregan\AppData\Local\Programs\Python\Python37-32\lib\site packages\pandas\core\frame.py”,第2724行,在_getitem_数组中
返回自取(索引器,轴=0)
文件“C:\Users\timregan\AppData\Local\Programs\Python\Python37-32\lib\site packages\pandas\core\generic.py”,第2789行,在
验证=真)
文件“C:\Users\timregan\AppData\Local\Programs\Python\Python37-32\lib\site packages\pandas\core\internals.py”,第4539行,在take中
轴=轴,允许(重复=真)
reindex\U索引器中的文件“C:\Users\timregan\AppData\Local\Programs\Python 37-32\lib\site packages\pandas\core\internals.py”,第4425行
适用于blk(自建区块)
文件“C:\Users\timregan\AppData\Local\Programs\Python\Python37-32\lib\site packages\pandas\core\internals.py”,第4425行,在
适用于blk(自建区块)
文件“C:\Users\timregan\AppData\Local\Programs\Python\Python37-32\lib\site packages\pandas\core\internals.py”,第1258行,在take\n中
允许填充=真,填充值=填充值)
文件“C:\Users\timregan\AppData\Local\Programs\Python\Python37-32\lib\site packages\pandas\core\algorithms.py”,第1655行,在take\n中
out=np.empty(out\u形状,dtype=dtype)
记忆者
在内存大的机器上,我需要做什么特别的事情来防止错误(例如寻址错误)


注意:我没有将代码包含在
filter\u anevexp
函数中,因为我对如何减少其内存占用的建议不感兴趣。我很想了解为什么运行在同一数据上的同一代码在128GB RAM机器上失败并出现内存错误,而在8GB RAM机器上成功了?

您的家用电脑使用的是32位版本,这意味着您的python可执行文件只能访问4gb的RAM。尝试用64位而不是当前使用的32位重新安装python37。

我也在GitHub上提交了此文件。好吧,32位python版本会带来什么?(
Python37-32
)抓得好。128 GB RAM机器运行32位Python,而较小的机器运行64位Python。卸载32位和安装64位解决了我的问题,谢谢。