当前位置: 代码迷 >> 综合 >> Numpy生成均匀间隔矩阵
  详细解决方案

Numpy生成均匀间隔矩阵

热度:72   发布时间:2024-02-05 11:35:58.0
import numpy as np
# np.linspace( start, stop, n, endpoint=True, retstep=False, dtype )
# 在start到stop区间内,生成n个样本数,endpoint代表stop值是否包含,retstep是否返回步长,dtype数据类型,Ture和False大写np.linspace(1,100,10,endpoint=True,retstep=True,dtype=float)(array([  1.,  12.,  23.,  34.,  45.,  56.,  67.,  78.,  89., 100.]), 11.0)