课程评价 (0)

请对课程作出评价:
0/300

学员评价

暂无精选评价
15分钟

从数值区间创建

  1. np.arange([start,] stop[, step,][, dtype]):返回均匀间隔的值组成的一维ndarray。区间是半闭半开的[start,stop),其采样行为类似Python的range函数。start为开始点,stop为终止点,step为步长,默认为1。这几个数可以为整数可以为浮点数。注意如果step为浮点数,则结果可能有误差,因为浮点数相等比较不准确。
  2. np.linspace(start, stop[, num, endpoint, ...]) :返回num个均匀采样的数值组成的一维ndarray(默认为50)。区间是闭区间[start,stop]endpoint为布尔值,如果为真则表示stop是最后采样的值(默认为True),否则结果不包含stopretstep如果为True则返回结果包含采样步长step,默认为True
  3. np.logspace(start, stop[, num, endpoint, base, ...]):返回对数级别上均匀采样的数值组成的一维ndarray。采样点开始于base^start,结束于base^stopbase为对数的基,默认为 10。
    • 它逻辑上相当于先执行arange获取数组array,然后再执行base^array[i]获取采样点
    • 它没有retstep 关键字参数