I have a list(thislist), i split it in smaller lists(nested) and i want to take each index of the nested list and save it in different list,array etc
thislist = [39.435138344488145, 22.73229454094485, 39.43684333469196, 22.73215634579526, 39.43681019007974, 22.731609175156223, 39.43507007579199, 22.731759378861057, 39.43511979394629, 22.732236812065707, 39.435138344488145, 22.73229454094485]
n = 2
def divide_chunks(l, n):
for i in range(0, len(l), n):
yield l[i:i + n]
x = list(divide_chunks(thislist, n))
print(x)
I expect the output to be like:
list1=[39.435138344488145, 22.73229454094485]
list2=[39.43684333469196, 22.73215634579526]
list3= [39.43681019007974, 22.731609175156223]
etc