import numpy as np
【1】np.mean(data,axis = 1) #求均值
axis = 1 按行求均值,返回m行1列,axis =0 按列求均值,返回1行m列
官方手册:https://docs.scipy.org/doc/numpy/reference/generated/numpy.mean.html
【2】np.cov(data) #求矩阵的协方差
参数详解见博客:https://blog.youkuaiyun.com/jeffery0207/article/details/83032325
【3】np.argsort()
argsort()函数是将x中的元素从小到大排列,提取其对应的index(索引),然后输出
【4】 arr.T #求矩阵的转置矩阵,适用于一维、二维转置
【5】np.linalg.svd(a, full_matrices=True, compute_uv=True) #svd奇异值分解
返回三个矩阵 U,S,V的转置
参数解释:a为数组;
full_matrices =True (默认),返回的U,V是(M,M)与(N,N),否则为(M,K)(K,N)
compute_uv=True(默认),返回U,S,V的转置。否则返回一个S。
官方文档:https://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.svd.html[]
【6】np.transpose(a,axes=None) #求矩阵的转置
a为数组,axes 为指定的索引顺序,只针对三维及其以上数组有用。二维默认为None。
三维假设数组大小为:reshape(3,4,2)即3个4*2数组。默认axes = (0,1,2)
当axes = (1,0,2)时,对应的数组的reshape为(4,3,2),即变成了4个3*2的矩阵。
官方文档:https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.transpose.html
【7】np.linspace(start, stop, num, endpoint=True, retstep=False, dtype=None) #产生制定大小的数组
参数解释:https://www.cnblogs.com/gengyi/p/9363185.html
【8】np.newaxis()#作用就是在这一位置增加一个一维
举例:https://blog.youkuaiyun.com/molu_chase/article/details/78619731
https://www.jianshu.com/p/78e1e281f698
【9】np.ravel()和np.flatten() #将数组展平
区别:https://blog.youkuaiyun.com/hanshuobest/article/details/78882425
2383

被折叠的 条评论
为什么被折叠?



