Numpy 的 T
屬性返回數組的轉置。
例子
假設我們有以下二維數組:
a = np.array([[1,2], [3,4]])
a
array([[1, 2],
[3, 4]])
進行轉置:
a.T
array([[1, 3],
[2, 4]])
請注意,對一維數組進行轉置隻會返回數組本身。
相關用法
- Python BeautifulSoup Tag contents屬性用法及代碼示例
- Python BeautifulSoup Tag string屬性用法及代碼示例
- Python Thread join()用法及代碼示例
- Python Django TodayArchiveView用法及代碼示例
- Python Tensorflow asin()用法及代碼示例
- Python Django TransactionNow用法及代碼示例
- Python Thread run()用法及代碼示例
- Python TextBlob.correct()用法及代碼示例
- Python Tuple len()用法及代碼示例
- Python Tensorflow math.accumulate_n()用法及代碼示例
- Python Tensorflow cosh()用法及代碼示例
- Python Pandas Timestamp構造函數用法及代碼示例
- Python Django TransactionTestCase.reset_sequences用法及代碼示例
- Python BeautifulSoup Tag decompose方法用法及代碼示例
- Python Tuple min()用法及代碼示例
- Python Thread setName()用法及代碼示例
- Python TextCalendar prmonth()用法及代碼示例
- Python Tensorflow sin()用法及代碼示例
- Python Tuples轉Dictionary用法及代碼示例
- Python Django TestCase.setUpTestData用法及代碼示例
- Python Tensorflow acos()用法及代碼示例
- Python Tuple轉integer用法及代碼示例
- Python Pandas Timedelta構造函數用法及代碼示例
- Python Django TransactionTestCase.assertNumQueries用法及代碼示例
- Python Tableau TableauAuth用法及代碼示例
注:本文由純淨天空篩選整理自Isshin Inada大神的英文原創作品 NumPy | T property。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。