Remove rows containing empty list of tuples in pandas

Viewed 1060

I have a dataframe like following

name     foo_list
'foo'    [('bleh'), ('blah')]
'bar'    [(), 'boo']
'foobar'  [(), (), ()]

I want to remove all the empty tuples and incase all the vals in list are empty tuples, just drop the row entirely. Also, I want to convert this list of tuples into list. So, output would be

name     foo_list
'foo'    ['bleh', 'blah']
'bar'    [ 'boo']

How do i do this in pandas?

2 Answers
Related