wxcc.net
当前位置:首页 >> python numpy 列向量 >>

python numpy 列向量

>>> import numpy as np>>> a = np.arange(1,11).reshape(10,1)>>> b = a * 1.1>>> c = a / 1.1>>> aarray([[ 1], [ 2], [ 3], [ 4], [ 5], [ 6], [ 7], [ 8], [ 9], [10]])>>> barray([[ 1.1], [ 2.2], [ 3.3], [ 4.4], [ 5.5], [ 6.6], [ 7.7]...

直接用实例说明: In [1]: import numpy In [2]: a = array([[1,2,3],[4,5,6]]) In [3]: b = array([[9,8,7],[6,5,4]]) In [4]: numpy.concatenate((a,b)) Out[4]: array([[1, 2, 3], [4, 5, 6], [9, 8, 7], [6, 5, 4]]) 或者这么写 In [1]: a =...

下面是基于python3.4的 这样子: import numpy as nparr = [1,2,3,4,5,6,7,8,9]matrix_a = np.array(arr)print(matrix_a)

网站首页 | 网站地图
All rights reserved Powered by www.wxcc.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com