I have the following nested list of lists:
a = [[[[-79.43402638260521, -1.69184588855758], [-79.4339722432865, -1.691845844583909], [-79.43397178076256, -1.691851284533779],
[-79.43395283944169, -1.692053292637794], [-79.43395281911414, -1.692054736321033], [-79.43395535750368, -1.692093535418117],
[-79.43390444734398, -1.69223087834723], [-79.43390428016939, -1.692231372437897], [-79.43374523144152, -1.692750043925838],
[-79.4340256570161, -1.692750271834557], [-79.43402638260521, -1.69184588855758]]], [[[-79.43381375958064, -1.691845715849684],
[-79.43312765678151, -1.691845158387183], [-79.4331269307764, -1.692749541273626], [-79.43354270912953, -1.692749879305633],
[-79.43364983051107, -1.692588468489809], [-79.4336510738479, -1.692585646334773], [-79.43371548446397, -1.692327269168548],
[-79.43380554258165, -1.692094789340216], [-79.43380615195998, -1.692091785860122], [-79.43381375958064, -1.691845715849684]]]]
How would I go from that to:
a = [[-79.43402638260521, -1.69184588855758], [-79.4339722432865, -1.691845844583909], [-79.43397178076256, -1.691851284533779],
[-79.43395283944169, -1.692053292637794], [-79.43395281911414, -1.692054736321033], [-79.43395535750368, -1.692093535418117],
[-79.43390444734398, -1.69223087834723], [-79.43390428016939, -1.692231372437897], [-79.43374523144152, -1.692750043925838],
[-79.4340256570161, -1.692750271834557], [-79.43402638260521, -1.69184588855758], [-79.43381375958064, -1.691845715849684],
[-79.43312765678151, -1.691845158387183], [-79.4331269307764, -1.692749541273626], [-79.43354270912953, -1.692749879305633],
[-79.43364983051107, -1.692588468489809], [-79.4336510738479, -1.692585646334773], [-79.43371548446397, -1.692327269168548],
[-79.43380554258165, -1.692094789340216], [-79.43380615195998, -1.692091785860122], [-79.43381375958064, -1.691845715849684]]
so basically remove the nested list and the double brackets at the beginning and end of each list. I've tried the following and ittertools without succes:
flatten = lambda list: [item for sublist in list for item in sublist]
Note: len(a) == 2
Many thanks!
a[0][0]?len(a) == 2