pandas中 df.eval( 如果A>0 则 B= 1 否则 B=2, inplace=True)这样的代码能实现吗?怎么实现?

pandas中 df.eval( 如果A>0 则 B= 1 否则 B=2, inplace=True)这样的代码能实现吗?怎么实现?

是要生成新列?

img