There have been questions asked that are similar to what I'm after, but not quite, like Python 3: Removing an empty tuple from a list of tuples, but I'm still having trouble reading between the lines, so to speak.
Here is my data structure, a list of tuples containing strings
data
>>[
('1','1','2'),
('','1', '1'),
('2','1', '1'),
('1', '', '1')
]
What I want to do is if there is an empty string element within the tuple, remove the entire tuple from the list.
The closest I got was:
data2 = any(map(lambda x: x is not None, data))
I thought that would give me a list of trues' and falses' to see which ones to drop, but it just was a single bool. Feel free to scrap that approach if there is a better/easier way.