I have a list of 50,000 integers:
I want to create a list of sublists from this large list.
The sublist is created by finding within the list the position that has a difference with the first value of the list of 1,000,000.
Below is my code:
sub_pos_list = []
for i in range(0, len(pos_list)): difference = pos_list[i] - pos_list[0] if difference <= 1000000:sub_pos_list.append(pos_list[0:i])
However, this only grabs the first 1,000,000 difference. I want to then delete this region from the list and start over again.
I want to create multiple sublists of 1,000,000 difference and then make a list of these sublists.
Any suggestions how to do this?