我有一个下面这样的数据框
name ... agg_data
787 418 Media ... [0.37]
799 A3 Artists Agency ... [0.85]
801 A3 Artists Agency ... [0.08]
808 A3 Artists Agency ... [0.13]
811 A3 Artists Agency ... [0.55]
... ... ... ...
7028 Young and Profiting LLC ... [0.35]
7031 Young and Profiting LLC ... [0.07]
7032 Young and Profiting LLC ... [0.06]
7035 Young and Profiting LLC ... [0.33]
7040 Zaddy Inc ... [0.15]
AGG_DATA列的值可能类似于[0.15,null]
我想查询VAL的长度为2,但长度为空
我试着像
condition = lambda x: any(val == '' or val is None for val in x) and len(x) == 2
condition = (result['agg_data'].isnull().any() &
(len(result['agg_data'] == 2))
但它不起作用
有什么帮助吗 谢谢