摘要: 在python库numpy 中提供了函数linspace和logspace函数用于生产等差数列和等比数列。 1.linspace函数生成等差数列 def linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None): 阅读全文
posted @ 2017-12-16 11:27 未完代码 阅读(43701) 评论(0) 推荐(1) 编辑
摘要: 1.type 获取数据类型 2.dtype 数组元素的类型 3.astype 修改数据类型 阅读全文
posted @ 2017-12-16 10:24 未完代码 阅读(39835) 评论(0) 推荐(1) 编辑
摘要: 1. numpy.reshape 重塑 reshape是一种函数,函数可以重新调整矩阵的行数、列数、维数。 B = reshape(A,m,n) 返回一个m*n的矩阵B, B中元素是按列从A中得到的。如果A中元素个数没有m*n个, 则会引发错误。 2.numpy.shape 输入参数:类似数组(比如 阅读全文
posted @ 2017-12-16 09:38 未完代码 阅读(370) 评论(0) 推荐(0) 编辑