全部, 我有一个看起来像这样的数据框。
PctPerBroker MaxPctBalance MinPctBalance
29 0.222204 0.3 0.1
30 0.172765 0.3 0.1
31 0.166435 0.3 0.1
32 0.211877 0.3 0.1
33 0.226718 0.3 0.1
我正在努力解决一些基本问题:
if ( (Broker['PctPerBroker']>Broker['MaxPctBalance'])| Broker['PctPerBroker']<Broker['MinPctBalance']) ):
do something
我遇到错误
if ( (Broker['PctPerBroker']>Broker['MaxPctBalance']) ):# | (Broker['PctPerBroker']<Broker['MinPctBalance']) ):
File "/apps/qtrinst/install/python/anaconda/envs/sx_anaconda/lib/python3.5/site-packages/pandas/core/generic.py", line 1121, in __nonzero__
.format(self.__class__.__name__))
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
我要去哪里错了?非常感谢