from list of lists to list code example
Example 1: python flatten list
itertools.chain.from_iterable(factors)
Example 2: convert list of list to list python
merged = list(itertools.chain.from_iterable(list2d))
itertools.chain.from_iterable(factors)
merged = list(itertools.chain.from_iterable(list2d))