find and delete from more-dimensional numpy array
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have two numpy-arrays: p_a_colors=np.array([[0,0,0], [0,2,0], [119,103,82], [122,122,122], [122,122,122], [3,2,4]]) p_rem = np.array([[119,103,82], [122,122,122]]) I want to delete all the columns from p_a_colors that are in p_rem, so I get: p_r_colors=np.array([[0,0,0], [0,2,0], [3,2,4]]) I think, something should work like p_r_colors= np.delete(p_a_colors, np.where(np.all(p_a_colors==p_rem, axis=0)),0) but I just don't get the axis or [:] right. I know, that p_r_colors=copy.deepcopy(p_a_colors) for i in range(len(p_rem)): p_r_colors= np