I have a data frame like this:
test = pd.DataFrame(columns=['A','B'])
test.loc[0,'A'] = 'a'
test.loc[0,'B'] = []
test.loc[1,'A'] = 'b'
test.loc[1,'B'] = ['a','b']
I want to get another data frame which contains the rows when column 'B' containing an empty list. What's the pythonic way of doing it?
A B
0 a []
Many thanks
test[test['B'].str.len()==0]