I got the following piece of code:
var = []
for i in range(0,len(code_list)-11):
sorted_list = sorted(code_list[i:i+10])
minmax_list = list(range(min(sorted_list), max(sorted_list)+1))
if (sorted_list == minmax_list):
var = var+lista_ordenada
When the code_list is so large a memory error return.
However, when replacing for the following:
var = []
for i in range(0,len(code_list)-11):
sorted_list = sorted(code_list[i:i+10])
minmax_list = np.arange(min(sorted_list), max(sorted_list)+1, 1).tolist()
if (sorted_list == minmax_list):
var = var+lista_ordenada
The routine ends successfully. Does anyone know the reason?
Thanks in advance!