The compiler return an error
Process finished with exit code 137 (interrupted by signal 9: SIGKILL)
when running the following code
import itertools
x = [11, 12, 13]
all_result=[p for p in itertools.product(x, repeat=1000)]
Is there are way to avoid getting this kind of issue by tweaking the module setting. I know in numpy.meshgrid, there is the option sparse
to conserve memory.
Is this possible apply something like this with itertools.
Or if there is other existing permutation module than can handle memory better than the itertools.
p.s.
To give better perspective as rise by @Carcigenicate, the outputs of the all_result
will be used in the following code. For simplicity, assume repeat set to two, and one of the pair is {11,13}.
tot_length=0.2
steps=0.1
start_val=0
list_no =np.arange(start_val, tot_length, steps)
x, y, z = np.meshgrid(*[list_no for _ in range(3)], sparse=True)
ix = np.array(((x>=y) & (y>=z)).nonzero()).T
final_opt=list_no[ix]
final_opt[:,[0, 1]] = final_opt[:,[1, 0]]
# The value {11,13} will be inputted at the last line below
FTE_DEF=np.concatenate((final_opt[11,:], final_opt[13,:]))