I guess this problem has two parts:
- Remove a list of exclusively empty elements from a list of lists
- Remove an element at a certain index from every list in a list of lists if the element is always empty.
I'd like to avoid using pandas and I'm sure there's some solution involving list comprehension. You can assume the list of lists will be rectangular.
Example:
Given:
lol = [['a',None,'c'],[None,None,None],['g',None,'i'],['j',None,None]]
(edit - wrote 'None' instead of None)
return:
lol = [['a','c'],['g','i'],['j',None]]