developed_countries = ["NOR","AUS","CHE","DEU","DNK","SGP","NLD","IRL","ISL","CAN","USA","NZL","SWE","LIE","GBR"]
recent_indicators['Developed'] = np.where(recent_indicators['CountryCode'] in developed_countries, 1, 0)
"ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()."
最近的\u指标是数据帧。有什么办法可以检查发达国家是否提到“国家代码”?你知道吗
您可以直接在中使用
.isin()
-此外,如果开发了一个布尔列,它会显示
True
-相关问题 更多 >
编程相关推荐