摘要:
今天在网上搜寻了许多博客,始终没有真正理解numpy中的transpose()函数, transpose 的原理其实是根据维度(shape)索引决定的,举个栗子: x = np.arange(4).reshape((2,2)) //生成一个2x2的数组print(x)[[0 1] [2 3]]我们生 阅读全文
posted @ 2020-01-14 15:25
sgggr
阅读(2110)
评论(0)
推荐(0)
摘要:
今天学习到numpy基本的运算方法,遇到了一个让我比较难理解的问题。就是dot函数是如何对矩阵进行运算的。 一、dot()的使用 参考文档:https://docs.scipy.org/doc/numpy/reference/generated/numpy.dot.html dot()返回的是两个数 阅读全文
posted @ 2020-01-14 15:11
sgggr
阅读(386)
评论(0)
推荐(0)
摘要:
a = [1,3,4,2,'a','d'] print a[::-1] 可以得到['d', 'a', 2, 4, 3, 1]; a[::-1],就是将a翻转过来的意思,从最后一个到第一个开始 a = [1,3,4,2,'a','d'] #a = (1,2,3) print a[3::-1] 可以得到 阅读全文
posted @ 2020-01-14 15:08
sgggr
阅读(353)
评论(0)
推荐(0)
摘要:
数组转置和轴对换 In [44]: %cpaste Pasting code; enter '--' alone on the line to stop or use Ctrl-D. :arr=np.arange(15).reshape(3,5) :-- In [45]: arr Out[45]: 阅读全文
posted @ 2020-01-14 14:55
sgggr
阅读(118)
评论(0)
推荐(0)