numpy.linspace()
来源:互联网 发布:啤酒配方软件中文版 编辑:程序博客网 时间:2024/05/17 00:17
numpy.linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None)
功能:生成一个指定间隔数的数组。
参数:(1)start:序列的起始值(2)stop:序列的终止值(3)生成的样本数(默认值=50)
(4)endpoint:该值取True时,序列的终止值包括stop;反之不包括。
(5)retstep:该值取True时,生成的数组中显示间距;反正不显示。
(6)dtype:数据类型;输出数组的类型。如果没有给出dtype,则从其他输入参数中推断数据类型。
例子:
>>>numpy.linspace(1,10,10)>>>array([ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10.])
>>>numpy.linspace(1,10,10,endpoint = False)>>>array([ 1. , 1.9, 2.8, 3.7, 4.6, 5.5, 6.4, 7.3, 8.2, 9.1])
>>>numpy.linspace(1,10,10,retstep= True)>>>(array([ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10.]), 1.0)
拓展例子:
>>>numpy.linspace(1,10,10).reshape([10,1])>>>array([[ 1.], [ 2.], [ 3.], [ 4.], [ 5.], [ 6.], [ 7.], [ 8.], [ 9.], [ 10.]])
阅读全文
0 0
- numpy.linspace()
- numpy学习之linspace
- numpy.linspace使用详解
- numpy中linspace用法
- numpy中linspace用法
- numpy.linspace使用详解
- numpy.linspace使用详解...
- numpy中linspace用法
- numpy.linspace使用详解
- numpy函数linspace() newaxis()
- numpy模块笔记之linspace
- numpy.linspace 生成等差数组
- 均分函数 numpy.arange() 和 numpy.linspace()
- python中numpy模块中的linspace函数
- numpy之linspace函数:等差,行向量
- numpy模块的linspace函数实例
- Python numpy函数:linspace()创建等差数列
- linspace
- 《TCP/IP详解 卷1》 笔记: TCP连接的建立与终止
- C语言中的extern关键字
- 顺序队列实现迷宫寻经
- Hibernate的学习之路六(加载配置)
- 上传到github详细简单步骤
- numpy.linspace()
- Python实现KNN算法项目 --- 水果分类
- 下载网页视频的方法
- pyw与py的区别
- 在C#环境中与Lua进行交互(二)
- Linux apache 2
- 关于Unity遮罩
- SpringBoot 热部署 和 yml类型配置文件
- Andrew Ng's deeplearning Course2Week2 Optimization algorithms(优化算法)