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…
可以来我的Github看原文,欢迎交流. https://github.com/AsuraDong/Blog/blob/master/Articles/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/numpy%E6%95%B0%E7%BB%84%E3%80%81%E5%90%91%E9%87%8F%E3%80%81%E7%9F%A9%E9%98%B5%E8%BF%90%E7%AE%97.md import numpy as np import pandas as pd…