I am working on list comprehension in python.
l = [['200801', '100'], ['', ''], ['200802', '151'], [''], ['200805', '160'] ,['', u''], [''], [u'\xa0'], ['\r\n \r\n ', '\r\n '], ['200812', '50']]
I want output as
[['200801', '100'], ['200802', '151'], ['200805', '160'], ['200812', '50']]
How can I remove such uncertain inner list of variable length and extra characters?
Here is one approach:
I don’t like it much though, it’s doing too much in one line.
If you could describe better what you are trying to words, you’ll find it a lot easier to describe in Python (or any other language).