2019-03-08

Python - Flatten list of lists using list comprehension

flat = [
y
for x in list_of_lists 
for y in x
]


Credits: https://coderwall.com/p/rcmaea/flatten-a-list-of-lists-in-one-line-in-python

No comments:

Post a Comment