
Python
文章平均质量分 92
Python
未能羞涩但娇痴
Where'd you want to go? How much you want to risk?
展开
-
NumPy 矩阵的运算
数组的创建使用 array 函数通过传入 list 或 tuple 来创建 NumPy 的 array 对象。 import numpy as np arr1 = np.array([1, 2, 3]) # 列表 arr2 = np.array((1, 2, 3)) # 元组 arr3 = np.array([[1, 2, 3], [1, ...原创 2019-10-19 22:02:23 · 320 阅读 · 0 评论 -
[Python] x.x-装饰器
功能函数比如现在有一个函数:# 累加 0-10000def accumulate_add(): count = 0 for i in range(10001): count = count + i print(count) 新需求现在有一个新的需求,就是要计算函数的运行时间,我们可以这样做:import time# 累加并计时d...原创 2019-10-18 13:00:10 · 160 阅读 · 0 评论