I know there are many posts on how I can flatten a two-dimensional list but this one is a bit different because it's a mix of two dimensional and three-dimensional list :
items = [[255, 204, 204], ..., [255, 179, 179], [[250, 250, 250], ..., [220, 220, 220]]] I'd like this list to be two dimentional only :
items = [[255, 204, 204], ..., [255, 179, 179], [250, 250, 250], ..., [220, 220, 220]] I tried to use list comprehension but it doesn't flatten the list correctly :
flat_list = [item for items in l for item in items] What would be the best way of flattening mixed dimensional array into a two-dimensional one?