console.log(🐂🍺);|

[Python]Numpy 生成等差等比数列

在python库numpy 中提供了函数linspace和logspace函数用于生产等差数列和等比数列。

    1.linspace函数生成等差数列

def linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None):

指定初始值、终止值、数量、是否包含终止值,默认为包含。

 



2.logspace函数生成等比数列
def logspace(start, stop, num=50, endpoint=True, base=10.0, dtype=None):
指定初始值、终止值、数量、是否包含终止值,默认为包含。

本文作者:SkyBiuBiu

本文链接:https://www.cnblogs.com/Skybiubiu/p/12463262.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   SkyBiuBiu  阅读(1470)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起