python中axis是什么意思_Python axis的含义
生活随笔
收集整理的這篇文章主要介紹了
python中axis是什么意思_Python axis的含义
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
axis=0表述列
axis=1表述行
如下面例子:
In [52]: arr=np.arange(12).reshape((3,4))
In [53]:arr
Out[53]:
array([[ 0, 1, 2, 3],
[ 4, 5, 6, 7],
[ 8, 9, 10, 11]])
In [54]:np.concatenate([arr,arr],axis=0)
Out[54]:
array([[ 0, 1, 2, 3],
[ 4, 5, 6, 7],
[ 8, 9, 10, 11],
[ 0, 1, 2, 3],
[ 4, 5, 6, 7],
[ 8, 9, 10, 11]])
In [55]:np.concatenate([arr,arr],axis=1)
Out[55]:
array([[ 0, 1, 2, 3, 0, 1, 2, 3],
[ 4, 5, 6, 7, 4, 5, 6, 7],
[ 8, 9, 10, 11, 8, 9, 10, 11]])
---------------------
作者:Rango_lhl
總結
以上是生活随笔為你收集整理的python中axis是什么意思_Python axis的含义的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python3 console inpu
- 下一篇: vuefullcalendar怎么判断切