Python的std lib中是否有linspace函数? [英] Does Python have a linspace function in its std lib?

查看:69
本文介绍了Python的std lib中是否有linspace函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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.linspacenumpy.

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函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆