1. 数组的集合运算 1.1. 并集 np.union1d(a,b)计算数组的并集: In [1]: import numpy as np In [2]: a = np.array([1,2,3]) In [3]: b = np.array([3,4,5]) In [4]: np.union1d(a,b) Out[4]: array([1, 2, 3, 4, 5]) 1.2. 交集 np.intersect1d(a,b)计算数组的交集: In [10]: import numpy as np I…