NUMPY學習系列——花哨的索引

若web a = array([0,1,2,3,4,5,6,7,8,9]), b = array([[0,1,2,3], [4,5,6,7], [8,9,10,11]]) 那麼: 索引對象爲向量數組 方法一:[x[3],x[7],x[2]] 即array([3,7,2]) 方法二:ind = [3,7,2] x[ind]
相關文章
相關標籤/搜索