# 4.如何获取数组a = np.array([1,2,3,2,3,4,3,4,5,6])和数组b = np.array([7,2,10,2,7,4,9,4,9,8])之间的共元素?...# 法1
a = np.array([1,2,3,2,3,4,3,4,5,6])
b = np.array([7,2,10,2,7,4,9,4,9,8])
index=np.isin(a,b)
print...(index)
elements=np.unique(a[index])
print(elements)
# 法2
elements=np.intersect1d(a,b)
print(elements