pandas 的 .query() 不接受我使用类似 'XXX%' 来表达 startswith 的表达式

my expresion for using the like 'XXX%' to express startswith isn't accepted by .query() of pandas

这是我要传递给 pandas 的函数 .query() 的表达式 external_identifier LIKE '16%'and act_rea in ['None'] 但它带来了这个错误: 语法错误:语法无效

我遇到了问题,事实上我不能将 statswith 与 like 和 % 的表达式一起使用 正确的表达式是:

pandas.query('external_identifier.str.startswith("16") and act_rea in ["None"] ')