Python list comprehension to join list of lists [duplicate]
lists = [['hello'], ['world', 'foo', 'bar']]
combined = [item for sublist in lists for item in sublist]
Or:
import itertools
lists = [['hello'], ['world', 'foo', 'bar']]
combined = list(itertools.chain.from_iterable(lists))
from itertools import chain
combined = [['hello'], ['world', 'foo', 'bar']]
single = [i for i in chain.from_iterable(combined)]