python如何將數(shù)組轉(zhuǎn)變?yōu)槎S矩陣?
使用print函數(shù)實(shí)現(xiàn),代碼如下:
x = numpy.array([[1,2,3],[4,5,6],[7,8,9]])print x
print x.shape
輸出
[[1 2 3]
[4 5 6]
[7 8 9]]
(3L, 3L)
[Finished in 0.2s]
python如何將數(shù)組轉(zhuǎn)變?yōu)槎S矩陣?
使用print函數(shù)實(shí)現(xiàn),代碼如下:
x = numpy.array([[1,2,3],[4,5,6],[7,8,9]])print x
print x.shape
輸出
[[1 2 3]
[4 5 6]
[7 8 9]]
(3L, 3L)
[Finished in 0.2s]