标签:常见 函数 dataset sort函数 返回 求和 元素 data 对象
numpy模块# shape[0]返回对象的行数,shape[1]返回对象的列数
dataSetSize = dataSet.shape[0]
#一维列表  
L=range(5)  
shape(L)    #输出(5, )
#二维列表  
L=[[1,2,3],[4,5,6]]  
shape(L)   #输出(2,3) 即两行三列arraytile(A,reps)将A复制reps次tile(x,(n,m))用x构造一个n行m列矩阵sum(a,axis=0)为普通的求和a的每一行向量相加x.argsort(),将x中的元素从小到大排序import numpy as np
x=np.array([1,4,3,-1,6,9])
y=x.argsort()     #y的值为[3,0,2,1,4,5]标签:常见 函数 dataset sort函数 返回 求和 元素 data 对象
原文地址:https://www.cnblogs.com/liminghuang/p/9036513.html