
Python
ChadPro
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Numpy dot & multiply
np.dot 1.一维情况 import numpy as np a1 = np.array([1,2,3]) a2 = np.array([2,3,4]) mul1 = np.dot(a1, a2) print mul1 输出结果[20], 即是计算: a_{1} * a_{2}^{T} 2.二维情况 import numpy as np a1 = np.reshape(np.arange(...原创 2018-12-18 11:06:07 · 326 阅读 · 0 评论 -
Python --- Parse XML
Python Parse XML Use ElementTree 0. Import ElementTree 生来就是为了处理 XML ,它在 Python 标准库中有两种实现。一种是纯 Python 实现例如 xml.etree.ElementTree ,另外一种是速度快一点的 xml.etree.cElementTree 。你要记住: 尽量使用 C 语言实现的那种,因为它速度更快,而且消耗的内...原创 2018-12-18 16:01:43 · 3267 阅读 · 0 评论 -
Python---BroadCast
1. Numpy 1.创建 2*2*3的数据 import numpy as np l1 = np.arange(12) l1 = np.reshape(l1, (2,2,3)) print l1 [[[ 0 1 2] [ 3 4 5]] [[ 6 7 8] [ 9 10 11]]] 2.数据每一位加1 import numpy as np l1 = np.arange...原创 2018-12-18 16:29:14 · 910 阅读 · 1 评论