Python (32bit) operation error: memoryerror

Due to the recent use of 32-bit system, there are various problems in installing and running python

Most of the answers to this question on the Internet are: Python 32bit can only use 2G of memory at most. If it exceeds 2G, it will report an error memorierror. The solution is to use 64bit python

The situation I face is that the operating system cannot be replaced, so I can only explore the solution by myself

First, I checked that the amount of data is not small, but there should be no problem running

The sentence I reported wrong is

1 df_group = df.groupby(['col_name1','col_name1']).apply(def_name)

 

It is speculated that the memory occupied by the apply method is too large

 

solution

The problem is solved by using the for loop statement and splicing dataframe data with the merge or concat method, but the running speed is slow and the code is redundant

No better way has been found

 

Similar Posts: