问题描述
Python在其标准库中是否具有类似于matlab的linspace
的功能?
Does Python have a function like matlab's linspace
in its standard library?
如果没有,是否有一种简便的方法可以在不安装外部软件包的情况下实现它?
If not, is there an easy way to implement it without installing an external package?
这是在MATLAB中用对linspace的定义的快速便捷的操作.
Here's a quick and easy definition of linspace in matlab terms.
注意
我不需要链接定义的向量结果",列表就可以了.
I don't need a "vector result" as defined by the link, a list will do fine.
推荐答案
不,不是.您可以编写自己的代码(这并不难),但是如果您使用Python来实现matlab的某些功能,那么您肯定要安装具有numpy.linspace
的numpy
.
No, it doesn't. You can write your own (whicn isn't difficult), but if you are using Python to fulfil some of matlab's functionality then you definitely want to install numpy
, which has numpy.linspace
.
您可能会找到适用于Matlab用户的NumPy 信息.
这篇关于Python的std lib中是否有linspace函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!