我试图在包含带有np.where和条件的子字符串的数组中查找条目:
import numpy as np foo = "aa" bar = np.array(["aaa", "aab", "aca"]) np.where(foo in bar)
这只返回一个空数组. 为什么会这样? 还有一个很好的替代解决方案吗?
numpy where string-comparison python-3.4
numpy ×1
python-3.4 ×1
string-comparison ×1
where ×1