简体   繁体   English

MemoryError:无法为形状为 (5844379795,) 且数据类型为 int64 的数组分配 43.5 GiB

[英]MemoryError: Unable to allocate 43.5 GiB for an array with shape (5844379795,) and data type int64

I have a large dataframe and I am trying to update one column:我有一个大的 dataframe 并且我正在尝试更新一列:

Dataframe: Dataframe:

在此处输入图像描述

I would like to update the last column IsFraudsterStatus .我想更新最后一列IsFraudsterStatus

My Code:我的代码:

df= pd.concat(chunk_list,)
    def expand_fraud(no_fraud, fraud, col_name):
        t = pd.merge(no_fraud, fraud, on=col_name)
        if len(t):
            df.loc[df.ID.isin(t.ID_x), "IsFraudsterStatus"] = 1
            return True
        return False
    while True:
        added_fraud = False
        fraud = df[df.IsFraudsterStatus == 1]
        no_fraud = df[df.IsFraudsterStatus == 0]
        added_fraud |= expand_fraud(no_fraud, fraud, "DeviceId")
        added_fraud |= expand_fraud(no_fraud, fraud, "Email")
        added_fraud |= expand_fraud(no_fraud, fraud, "MobileNo")
        if not added_fraud:
            break

Error:错误:

在此处输入图像描述

Using Dask has solved all the "Memory Error" problems.使用Dask解决了所有的“内存错误”问题。

暂无
暂无

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

相关问题 Python MemoryError:无法为形状为 () 且数据类型为 int64 的数组分配 10.8 TiB - Python MemoryError: Unable to allocate 10.8 TiB for an array with shape () and data type int64 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:无法为形状为 (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 Python - MemoryError: 无法为 int64 类型的数组分配 - Python - MemoryError: Unable to allocate for an array with type int64 MemoryError: Unable to allocate 617. GiB for an array with shape (82754714206,) and data type float64 On Windows and using Python - MemoryError: Unable to allocate 617. GiB for an array with shape (82754714206,) and data type float64 On Windows and using Python MemoryError: 无法为形状 (2549150, 99) 和数据类型对象的数组分配 1.88 GiB - MemoryError: Unable to allocate 1.88 GiB for an array with shape (2549150, 99) and data type object MemoryError: Unable to allocate 5.62 GiB for an array with shape (16384, 30720, 3) and data type float32 when training StyleGan2 - MemoryError: Unable to allocate 5.62 GiB for an array with shape (16384, 30720, 3) and data type float32 When training StyleGan2 无法为形状为 (129213603, 28) 且数据类型为 int8 的数组分配 3.37 GiB - Unable to allocate 3.37 GiB for an array with shape (129213603, 28) and data type int8 Pandas 无法为形状 X 和数据类型 Y 的数组分配 GiB - Pandas unable to allocate GiB for an array with shape X and data type Y
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM