[問題] numpy.r_ 的使用方法 ?
小弟目前是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
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):