I tried different way to remove empty element to nested list, but I don't know if the best way on 100k list.
Example:
tag = [['A', 'B', 'C', ''], ['D', 'F', 'G', '', '',''], ['H','I','J'],['L','M','','','','']]
I find different approaches like:
list(filter(None, tag))
or
for i in tag:
test_list = [i for i in tag if i]
or
'' in [j for i in tag for j in i]
No way, I cannot remove empty element, first, and second, time to achieve it, is too slow. Also I tried to develop few nested list on python tutor, but don't remove anything.
Suggestion please? thank you