Flatten Python lists with itertools module¶
Every now and then you end up with a data structure that looks like this:
Then you would like to 'flatten' this list to essentially loop over it as a single list instead of a list of 2 separate, smaller lists. Well, check out the itertools module for a good recipe on how to do this.