flatten a list of list to a list code example
Example 1: flatten a list of lists python
flattened = [val for sublist in list_of_lists for val in sublist]
Example 2: python flatten list
itertools.chain.from_iterable(factors)
flattened = [val for sublist in list_of_lists for val in sublist]
itertools.chain.from_iterable(factors)