'List of lists' to 'list' without losing empty lists from the original list of lists
list-comprehension, python
Solution
Are you starting with the strings `'a'`, `'b'`, etc.? If so then you can use `''.join` to convert `['a']` into `'a'` and `[]` into `''`.
[''.join(l) for l in list_of_lists]
Problem
Usually I would use a comprehension to change my list of lists to a list. However, I don't want to lose the empty lists as I will zip the final list to another list and I need to maintain the placings. I have something like `list_of_lists = [['a'],['b'],[],['c'],[],[],['d']]` and I use this `[x for sublist in list_of_lists for x in sublist]` which gives me `['a','b','c','d']` but what I would like is `['a','b','','c','','','d']` Sorry if this is a stupid question, I am new to python. Thanks for any help!