![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
numpy使用
介绍一些numpy常见用法
SumFunction
这个作者很懒,什么都没留下…
展开
-
numpy使用3
numpy使用3矩阵相关应用import numpy as nptest1 = np.array([[1,2,3],[4,5,6],[7,8,9]])print(np.linalg.inv(test1))#求逆 求伪逆是pinvprint(np.mean(test1,axis=0))#按行求均值 axis=1按列求均值print(np.sum(test1,axis=0))#按行求和结果:[[-4.50359963e+15 9.00719925e+15 -4.50359963e+15] [原创 2021-02-28 20:50:46 · 55 阅读 · 0 评论 -
numpy使用2
numpy使用2numpy插入参数说明第一个 插入对象第二个 values 插入值第三个 axis=0是按行插入 =1是按列插入第四个 obj 插入在什么位置import numpy as np#无维度的numpy插入test1 = np.array([1,2,3])test2 = np.array([4,5,6])y = np.insert(test1,values=test2,axis=0,obj=1)print(y)输出结果:[1 4 5 6 2 3]可以看出 列表型的原创 2021-02-28 20:38:44 · 121 阅读 · 2 评论 -
numpy使用1
numpy使用1numpy数组的创建import numpytest1 = numpy.array([1,2,3])#这个不含维度test2 = numpy.array([[1,2,3]])#这个含大小 shape为(1,3)test3 = numpy.array([[1,2,3],[4,5,6]])print(test1)#无shape print(test2)#shape为(1,3)print(test3)#shape为(2,3)...原创 2021-02-28 18:23:50 · 169 阅读 · 2 评论