[問題] numpy.r_ 的使用方法 ?

看板Python作者 (Mr.Positive)時間7年前 (2017/03/20 11:19), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
小弟目前是numpy 新手,使用 numpy.r_ 看document 時看不太懂 A string with three comma-separated integers 的使用方式。 '0,2,0' 依據 two comma-seperated integers 的推法,我只知道沿著axis 0 就是 row 往下長,輸出至少要2個dimension。 但是第三個數值0,我一直無法參透 >>np.r_['0,2,0', [1,2,3], [4,5,6]].shape (6, 1) 以下是其他嘗試,我還是不太懂他的含意 >>np.r_['0,2,1', [1,2,3], [4,5,6]].shape (2, 3) >>np.r_['1,2,0',[1,2,3],[4,5,6]].shape (3, 2) >>np.r_['1,2,1',[1,2,3],[4,5,6]].shape (1, 6) 希望版上的numpy 大神們教教小弟 !! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.113.136.218 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1489979943.A.7C1.html
文章代碼(AID): #1OpqedV1 (Python)
文章代碼(AID): #1OpqedV1 (Python)