注意np.array元素比较是一个一个比的,例如:
import numpy as np
a = np.array([1, 4])
b = np.array([[1, 2], [3, 4]])
c = np.where(a == b)
d = [list(a) == list(b0) for b0 in b]
e = a in b
print(c)
print(d)
print(e)
输出为:
2023-12-18 07:53:51
注意np.array元素比较是一个一个比的,例如:
import numpy as np
a = np.array([1, 4])
b = np.array([[1, 2], [3, 4]])
c = np.where(a == b)
d = [list(a) == list(b0) for b0 in b]
e = a in b
print(c)
print(d)
print(e)
输出为: