- 微积分
- 蟒蛇编程
区分蟒蛇函数的Positional和Keyword参数。
Set(创建,访问和迭代)
列表理解(List Comprehension):下列两行代码是等价的。后者(ListComp)可读性更高。
1 squares = list(map(lambda x: x**2, range(10))) 2 squares = [x**2 for x in range(10)]View Code
[(1, 3), (1, 4), (2, 3), (2, 1), (2, 4), (3, 1), (3, 4)]
例如:将二维数组展开:
1 vec = [[1,2,3], [4,5,6], [7,8,9]] 2 [num for elem in vec for num in elem]View Code
[1, 2, 3, 4, 5, 6, 7, 8, 9]
标签:Code,机器,elem,学习,num,vec,先验,squares,View
From: https://www.cnblogs.com/ArmRoundMan/p/18368999