【发布时间】:2021-07-03 08:47:10
【问题描述】:
我尝试比较数据框中的两列(字符串类型) :
if((MODEL_STANDARD_df['FT']== "4") and (MODEL_STANDARD_df['FT_CODE'] == ' ')):
MODEL_STANDARD_df['ft2'] = "DIESEL"
但我收到此错误:
Error in Python process: At line 18: <type 'exceptions.ValueError'>:
The truth value of a Series is ambiguous. Use a.empty, a.bool(),
a.item(), a.any() or a.all(). More info about this error
有什么办法解决这个问题吗?
谢谢
【问题讨论】:
-
您是否尝试使用错误消息进行搜索 -
The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().?这些结果有帮助吗?如果其中任何一个结果回答了您的问题,请告诉我们哪一个,我们会将您的结果标记为重复。