python 用 np.logspace() 创建等比数列

等比数列通项为:an  = a1 * qn-1

基本语法:

np.logspace( start, stop, num=50, endpoint=True, base=10.0, dtype=None, axis=0, )

示例 1: 2n

np.logspace(1, 10, 10, base=2)

 

 

 示例 2: 3n

np.logspace(1, 10, 10, base=3)

 

 

示例 3: 1 + 2n

np.logspace(1, 10, 10, base=2) + 1

 

 

 

 

 

posted @ 2019-12-15 13:59  赏尔  阅读(3205)  评论(0编辑  收藏  举报