Let's say I have this:
d = {'a': [1, 2, 3, 4], 'b': ['10', '', '30', '40']}
And I'd like this:
d = {'a': [1, 3, 4], 'b': ['10', '30', '40']}
If I see an empty element in b
, I'd like to delete it, which is d["b"][1]
and the same time delete d["a"][1]
at the same index.
EDIT: Forget to mention, that you must not change the order of any elements.