作者will12345610 (Mr.Positive)
看板Python
标题[问题] numpy.r_ 的使用方法 ?
时间Mon Mar 20 11:19:01 2017
小弟目前是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://webptt.com/cn.aspx?n=bbs/Python/M.1489979943.A.7C1.html