Python
文章平均质量分 70
hei_hei_hei_
这个作者很懒,什么都没留下…
展开
-
python中的logging使用
python中logging模块的使用原创 2022-10-10 21:32:44 · 355 阅读 · 1 评论 -
python---进阶篇【函数使用技巧/注意事项】
map(func, seq1[, seq2,…]):处理值到函数的映射。func表示函数名,seq为序列,若函数的参数有多个则需多个序列。返回以序列为参数的func的结果序列,是一个可迭代对象,也可以直接遍历。 注:在python2中结果以list对象返回,在python3中结果以map对象返回,一般会在外层将其转化为list。 # example 1 x = list(map(lambda x: x % 2, range(7))) x # [0, 1, 0, 1, 0, 1, 0] # examp.原创 2022-09-03 11:21:37 · 930 阅读 · 0 评论 -
pytorch/numpy中的广播机制
pytorch和numpy中的广播机制原创 2022-06-12 21:12:26 · 96 阅读 · 0 评论 -
Python---基础篇
目录 1.函数参数 函数的参数 补充两种形式 (1)调用函数时指定(不清楚参数的顺序) def demo(a ,b): print(a) print(b) demo(b=1,a=5) output 5 1 (2)默认值 def demo(x,a=3 ,b=4): print(x) print(a) print(b) demo(5) output 5 3 4 注意没有默认值的参数要放在有定义值的前面 错误示例 正确示例 ...原创 2021-12-13 21:21:16 · 747 阅读 · 0 评论