Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python flat list from list of list

flat_list = [item for sublist in l for item in sublist]

#which is equivalent to this 
flat_list = []
for sublist in l:
    for item in sublist:
        flat_list.append(item)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #flat #list #list #list
ADD COMMENT
Topic
Name
4+5 =