admin管理员组

文章数量:1123589

please tell me how to fix the error: "MemoryError: Unable to allocate 65.3 GiB for an array with shape (8763449844,) and data type int64"

I have 2 small tables:

Data columns (total 6 columns):
 #   Column                Dtype 
---  ------                ----- 
 0   ART_GRP_LVL_2_ID      int32 
 1   cluster               object
 2   cluster new           int32 
 3   traffic               int32 
 4   WHS_ID                int32 
 5   opsum                 int32 
dtypes: int32(5), object(1)
memory usage: 224.7+ MB

Data columns (total 4 columns):
 #   Column              Non-Null Count   Dtype 
---  ------              --------------   ----- 
 0   ART_GRP_LVL_2_ID    752375 non-null  int32 
 1   ART_GRP_LVL_0_NAME  752375 non-null  object
 2   ART_GRP_LVL_1_NAME  752375 non-null  object
 3   ART_GRP_LVL_2_NAME  752375 non-null  object
dtypes: int32(1), object(3)
memory usage: 20.1+ MB
pd.merge(for_bottom_up, v_art_ext, on = 'ART_GRP_LVL_2_ID', how = 'left')

Why is there such an error, why is so much memory needed when merge? Thanks

changed all data types from int64 to int32, but the error is still int64

本文标签: pythonMemoryError Unable to allocateStack Overflow