摘要: numpy.arange numpy 包中的使用 arange 函数创建数值范围并返回 ndarray 对象,函数格式如下: numpy.arange(start, stop, step, dtype) 根据 start 与 stop 指定的范围以及 step 设定的步长,生成一个 ndarray。 阅读全文
posted @ 2019-12-24 14:34 略略略额 阅读(343) 评论(0) 推荐(0)
摘要: class Counter(object): def __init__(self): self.i = [1,2,3,4,5,6] self.n = iter(self.i) def __call__(self): x = next(self.n) print('call',x) return x 阅读全文
posted @ 2019-12-24 11:19 略略略额 阅读(252) 评论(0) 推荐(0)
摘要: numpy.asarray 类似 numpy.array,但 numpy.asarray 参数只有三个 numpy.asarray(a, dtype = None, order = None) 参数说明: 参数 描述 a 任意形式的输入参数,可以是,列表, 列表的元组, 元组, 元组的元组, 元组的 阅读全文
posted @ 2019-12-24 10:37 略略略额 阅读(985) 评论(0) 推荐(0)