作者shuian88 (shiuan)
看板Python
標題[問題] 如何將array在array中並排
時間Fri Jan 22 00:32:51 2016
以matlab來說 a=[1;2;3]3X1 矩陣
for i=1:3
b[:,i] = a;
end 可以直接擴充成3x3矩陣
在python中 想問有類似的寫法可以在array中逐行丟進array嗎
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 42.73.250.125
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1453393973.A.C16.html
推 secondsee: a=[1,2,3]; b=[a[:] for n in range(3)] 01/22 00:53
→ ykjiang: 要這樣比的話,建議用 NumPy 或 SciPy 01/22 21:27
推 yogi: numpy.append() 01/25 12:41