np.vectorize的
.get方法:
>>> a = np.array([[1,2,3], [3,2,4]])>>> my_dict = {1:23, 2:34, 3:36, 4:45}>>> np.vectorize(my_dict.get)(a)array([[23, 34, 36], [36, 34, 45]])
欢迎分享,转载请注明来源:内存溢出
np.vectorize的
.get方法:
>>> a = np.array([[1,2,3], [3,2,4]])>>> my_dict = {1:23, 2:34, 3:36, 4:45}>>> np.vectorize(my_dict.get)(a)array([[23, 34, 36], [36, 34, 45]])
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)