本文簡要介紹 python 語言中 numpy.column_stack
的用法。
用法:
numpy.column_stack(tup)
將一維數組作為列堆疊到二維數組中。
獲取一係列一維數組並將它們堆疊為列以形成單個二維數組。二維數組按原樣堆疊,就像
hstack
一樣。首先將一維數組轉換為二維列。- tup: 一維或二維數組的序列。
要堆疊的數組。它們都必須具有相同的第一維。
- stacked: 二維陣列
通過堆疊給定數組形成的數組。
參數:
返回:
例子:
>>> a = np.array((1,2,3)) >>> b = np.array((2,3,4)) >>> np.column_stack((a,b)) array([[1, 2], [2, 3], [3, 4]])
相關用法
- Python numpy copy用法及代碼示例
- Python numpy copysign用法及代碼示例
- Python numpy count_nonzero用法及代碼示例
- Python numpy correlate用法及代碼示例
- Python numpy cosh用法及代碼示例
- Python numpy conjugate用法及代碼示例
- Python numpy concatenate用法及代碼示例
- Python numpy cos用法及代碼示例
- Python numpy cov用法及代碼示例
- Python numpy conj用法及代碼示例
- Python numpy corrcoef用法及代碼示例
- Python numpy convolve用法及代碼示例
- Python numpy compress用法及代碼示例
- Python numpy common_type用法及代碼示例
- Python numpy chararray.ndim用法及代碼示例
- Python numpy chebyshev.chebsub用法及代碼示例
- Python numpy chararray.nbytes用法及代碼示例
- Python numpy chebyshev.chebdiv用法及代碼示例
- Python numpy chararray.setflags用法及代碼示例
- Python numpy chararray.flat用法及代碼示例
- Python numpy can_cast用法及代碼示例
- Python numpy chararray.strides用法及代碼示例
- Python numpy chebyshev.cheb2poly用法及代碼示例
- Python numpy chararray.view用法及代碼示例
- Python numpy chebyshev.chebx用法及代碼示例
注:本文由純淨天空篩選整理自numpy.org大神的英文原創作品 numpy.column_stack。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。