This question differs from Converting list of lists / nested lists to list of lists without nesting (this yields a very specific set of responses that do not address my situation) and also from the many "flatten list of lists to list" answers out there.
I want to take a list of lists, some of which are in turn lists of lists and "flatten" to a list of lists (not just a list!).
As a concrete example, I want to go from this:
my_list_of_lists = [[1, 2, 3], [[9, 10], [8, 9, 10], [3, 4, 6]], [11, 12, 13]]
to this
target_list_of_lists = [[1, 2, 3], [9, 10], [8, 9, 10], [3, 4, 6], [11, 12, 13]]
(In a visual sense, I want to turn all [[
and ]]
inside the outer list into [
and ]
respectively.)