IDE: No. Python IDEs are nowhere near as good or mature as MATLAB's, though I've heard good things about Wing IDE. Generally, I find IDEs to be total overkill for Python development, and find that I'm more productive with a well-setup text editor (vim in my case) and a separate visual debugger (WinPDB).
Changing functions: Modules must be reloaded after changes using the reload() built-in function.
import foo
#now you've changed foo.py and want to reload it
foo = reload(foo)
I've switched over myself from MATLAB to Python, because I find that Python deals much better with complexity, i.e., I find it easier to write, debug and maintain complex code in Python. One of the reasons for this is that Python is a general purpose language rather than a specialist matrix-manipulation language. Because of this, entities like strings, non-numerical arrays and (crucially) associative arrays (or maps or dictionaries) are first-class constructs in Python, as are classes.
With regards to capabilities, with NumPy, SciPy and Matplotlib, you pretty much have the whole set of functionality that MATLAB provides out of the box, and quite a lot of stuff that you would have to buy separate toolboxes for.
I've been getting on very well with the Spyder IDE in the Python(x,y) distribution. I'm a long term user of Matlab and have known of the existence of Python for 10 years or so but it's only since I installed Python(x,y) that I've started using Python regularly.
I have yet to use a full featured Python IDE, but have gotten on pretty well in IPython in combination with Matplotlib, Numpy, Scipy, etc. I actually use the Enthough Python Distribution that comes preloaded with most of the scientific/quantitative packages I need. I've also heard good things about Python(x,y) and Sage
Maybe other IDE's handle this but in IPython I use autoreload which works fairly well.
As others have mentioned, since the numerical/quantitative libraries came to Python instead of a numerical library hacking a language on top, you have an incredible amount of flexibility that you don't have with Matlab. Also the Python community, especially in the numerical/quantitative areas, is really quite fantastic.
I've been in the engineering field for a while now and I've always used MATLAB for high-complexity math calculations. I never really had an major problems with it, but I wasn't super enthusiastic about it either. A few months ago I found out I was going to be a TA for a numerical methods class and that it would be taught using Python, so I would have to learn the language.
What I at first thought would be extra work turned out to be an awesome hobby. I can't even begin to describe how bad MATLAB is compared to Python! What used to to take me all day to code in Matlab takes me only a few hours to write in Python. My code looks infinitely more appealing as well. Python's performance and flexibility really surprised me. With Python I can literally do anything I used to do in MATLAB and I can do it a lot better.
If anyone else is thinking about switching, I suggest you do it. It made my life a lot easier. I'll quote "Python Scripting for Computational Science" because they describe the pros of Python over MATLAB better than I do:
the python programming language is more powerful
the python environment is completely open and made for integration
with external tools,
a complete toolbox/module with lots of functions and classes can be contained in a single file (in contrast to a bunch of M-files),
transferring functions as arguments to functions is simpler,
nested, heterogeneous data structures are simple to construct and use,
object-oriented programming is more convenient,
interfacing C, C++, and fortran code is better supported and therefore simpler,
scalar functions work with array arguments to a larger extent (without modifications of arithmetic operators),
We use the Wing IDE for Python development. It is quite well featured, has integrated debugging support, and can be connected to the profiler of your choice.
Regarding (2), I know exactly what you mean since I miss that very same feature from Lisp, and so far as I know you need to actively reimport the libraries after changing them. This isn't a real hangup, though, since you can easily write (once) a small function that does that for every module you care about, and then put that function on a key macro so all you have to do is eg hit CTRL-T after changing code.
almost everything is covered by others .. i hope you don't need any toolboxes like optimizarion toolbox , neural network etc.. [ I didn't find these for python may be there are some .. i seriously doubt they might be better than Matlab ones..]
if u don't need symbolic manipulation capability and are using windows python(x,y) is the way to go[they don't have much activity on their linux port (older versions are available)]
(or need some minor symbolic manipulations use sympy , i think it comes with EPD and python(x,y) supersedes/integrates EPD)
if you need symbolic capabilities sage is the way to go, IMHO sage stands up good with Matlab as well as Mathematica ..
i'm also trying to make a switch ...(need for my engg projs)
after long long tryouts with many editors,
i have settled for aptana ide + ipython (including notebook in internet browser)
great for editing, getting help easy, try fast new things
aptana is the same as eclipse (because of pydev) but aptana has themes and different little things eclipse lacks
about python a little,
don't forget pandas, as it's (i believe) extremely powerful tool for data analysis
it will be a beast in the future, my opinion
i'm researching matlab, and i see some neat things there, especially gui interfaces and some other nice things
but python gives you flexibility and ease,
anyway, you still have to learn the basics of python, matplotlib, numpy (and eventually pandas)
but from what i see, numpy and matplotlib are similar to matplotlib concepts (probably they were created with matlab in mind, right?)
Much more recently, in mid-2013, I've been completely converted to Python, primarily due to the availability of the Matlab-like Spyder IDE, along with all-in-one installers for the entire Scientific Python & IDE environment.
PythonXY (windows only) and Continuum Analytics' Anaconda (Mac/Win/Linux) get you up and running rapidly, with no configuration, in a matlab-like IDE (Spyder), with variable inspector, file explorer, object inspector (displaying live help on the functions you type) etc. etc. It is now a full Matlab replacement for me.
One may switch from MATLAB to Python because Python deals much better with complexity i.e. easier to write, debug and maintain complex code. One of the good reasons for that is, Python is a general purpose language rather than a matrix-manipulation language. Because of this, entities like non-numerical arrays , strings and associative arrays are first-class constructs in Python.
We regularly hear of people and whole research groups that transition from Matlab to Python. The scientific Python ecosystem is maturing fast and Python is an appealing alternative, because it’s free, open source, and becoming ever more powerful. Let's explore of them in details.
Ecosystems of Matlab and Python
Python, by definition, is a programming language. The most common implementation is that in C also known as CPython and is what is mostly referred to as Python. Apart from the programming language and interpreter, Python also consists of an extensive standard library. This library is aimed at programming in general and contains modules for OS specific stuff, threading, networking, databases etc.
Matlab is a commercial numerical computing environment and programming language. The concept of Matlab refers to the whole package, including the IDE. The standard library does not contain as much generic programming functionality, but does include matrix algebra and an extensive library for data processing and plotting. For extra functionality the Mathworks provides toolkits (but these cose you extra).
To do scientific computing in Python, you need additional packages (e.g. Numpy, Scipy, Matplotlib). Additionally, you’ll need an IDE. Many pythoneers come from a Linux environment and use a Python shell and an editor (like vi or Emacs), but people coming from Matlab prefer a feature-rich IDE. Now today there are many handful and powerful IDE available for Python such as PyCharm , Spyder , Jupyter Notebook and many more.
Python packages is being developed by a different (but often overlapping) group of people, who are also users of the packages. Many packages are available for different purposes. In this open source ecosystem most packages are driven by a handful of core developers, but many of a package users contribute to the development by reporting issues, helping with documentation, and making small improvements to the code.
Advantages of Matlab
Let's pick up some of the advantages we can get from Matlab :
It has a solid amount of functions. Simulink is a product for which
there is no good alternative yet.
It might be easier for beginners, because the package includes all
you need, while in Python you need to install extra packages and an
IDE.
It has a large scientific community; it is used on many universities
(although few companies have the money to buy a license).
The problem with Matlab
Here we do not intend to make Matlab look bad. I used to love Matlab myself. However, i think that Matlab has a few fundamental shortcomings. Most of these arise from its commercial nature:
The algorithms are proprietary, which means you can not see the code
of most of the algorithms you are using and have to trust that they
were implemented correctly.
Matlab is quite expensive, which means that code that is written in
Matlab can only be used by people with sufficient funds to buy a
license.
Naturally, the Mathworks puts restrictions on code portability, the
ability to run your code on someone elses computer. You can run your
compiled application using the Matlab Component Runtime (MCR), but
your portable app must exactly match the version of the installed MCR, which can be a nuisance considering that Matlab releases a new
version every 6 months.
The proprietary nature also makes it difficult for 3th parties to extend the
functionality of Matlab.
Furtheremore, there are some other issues that stem from Matlabs origins as a matrix manipulation package:
The semicolon. It can be useful to show the result when you type code in the
console, but in scripts it does not make any sense that one must end a line
with a semicolon in order to suppress output.
Indexing is done with braces rather than brackets, making it difficult to
distinguish it from a function call.
Advantages of Python
The Python language has diversified application in the software development companies such as in gaming, web frameworks and applications, language development, prototyping, graphic design applications etc. This provides the language a higher plethora over other programming languages used in the industry. Before picking up some advantage of Python, just give a quick tour here. Now let's see some of the advantages of it -
Extensive Support Libraries
It provides large standard libraries that include the areas like string
operations, Internet, web service tools, operating system interfaces and
protocols. Most of the highly used programming tasks are already scripted into
it that limits the length of the codes to be written in Python.
Integration Feature
Python integrates the Enterprise Application Integration that makes it easy to
develop Web services by invoking COM or COBRA components. It has powerful
control capabilities as it calls directly through C, C++ or Java via Jython.
Python also processes XML and other markup languages as it can run on all
modern operating systems through same byte code.
Improved Programmer’s Productivity
The language has extensive support libraries and clean object-oriented designs
that increase two to ten fold of programmer’s productivity while using the
languages like Java, VB, Perl, C, C++ and C#.
Productivity
With its strong process integration features, unit testing framework and
enhanced control capabilities contribute towards the increased speed for most
applications and productivity of applications. It is a great option for
building scaleble multi-protocol network applications.
Disadvantages of Python
Python has varied advantageous features, and programmers prefer this language to other programming languages because it is easy to learn and code too. However, this language has still not made its place in some computing arenas that includes Enterprise Development Shops. Therefore, this language may not solve some of the enterprise solutions, and limitations include-
Difficulty in Using Other Languages
The Python lovers become so accustomed to its features and its extensive
libraries, so they face problem in learning or working on other programming
languages. Python experts may see the declaring of cast values or variable types, syntactic requirements of adding curly braces or semi colons as an
onerous task.
Weak in Mobile Computing
Python has made its presence on many desktop and server platforms, but it is
seen as a weak language for mobile computing. This is the reason very few
mobile applications are built in it like Carbonnelle.
Gets Slow in Speed
Python executes with the help of an interpreter instead of the compiler, which
causes it to slow down because compilation and execution help it to work
normally. On the other hand, it can be seen that it is fast for many web
applications too.
Run-time Errors
The Python language is dynamically typed so it has many design restrictions
that are reported by some Python developers. It is even seen that it requires
more testing time, and the errors show up when the applications are finally
run.
Underdeveloped Database Access Layers
As compared to the popular technologies like JDBC and ODBC, the Python’s
database access layer is found to be bit underdeveloped and primitive.
However, it cannot be applied in the enterprises that need smooth interaction
of complex legacy data
Advantages of Python over Matlab
Python code is more compact and easier to read than Matlab code
Unlike Matlab, which uses end statement to indicate the end of a block,
Python determines block size based on indentation.
Python uses square brackets for indexing and parentheses for functions and
methods, whereas Matlab uses parentheses for both, making Matlab more
difficult to differentiate and understand.
Python’s better readability leads to fewer bugs and faster debugging.
While most programming languages, including Python, use zero-based indexing,
Matlab uses one-based indexing making it more confusing for users to
translate.
The object-oriented programming (OOP) in Python is simple flexibility while
Matlab's OOP scheme is complex and confusing
Python is free and open
While Python is open source programming, much of Matlab is closed
The developers of Python encourage users to input suggestions for the
software, while the developers of Matlab offer no such interaction
Python offers a wider set of choices in graphics package and toolsets
With NumPy, SciPy and Matplotlib, you pretty much have the whole set of functionality that MATLAB provides out of the box, and quite a lot of stuff that you'd have to buy for separate toolboxes.
However, MatLab community has their own arguments to choose Matlab or Python, (yes seriously). Good reading though.
我最近从 MATLAB 切换到 Python(转换大约 2 个月),并且使用 Sublime Text 2 进展得相当好,使用 SublimeRope 和 SublimeLinter 插件提供一些类似 IDE 的功能,以及 pudb 提供一些图形交互调试功能。
我还没有探索过分析器或变量编辑器。 (无论如何,我从未真正使用过 MATLAB 变量编辑器)。
I have recently switched from MATLAB to Python (I am about 2 months into the transition), and am getting on fairly well using Sublime Text 2, using the SublimeRope and SublimeLinter plugins to provide some IDE-like capabilities, as well as pudb to provide some graphical interactive debugging capabilities.
I have not yet explored profilers or variable editors. (I never really used the MATLAB variable editor, anyway).
发布评论
评论(11)
IDE:不。Python IDE 远不如 MATLAB 那样好或成熟,尽管我听说过有关 Wing IDE 的好消息。一般来说,我发现 IDE 对于 Python 开发来说完全是多余的,并且发现使用设置良好的文本编辑器(在我的例子中是 vim)和单独的可视化调试器(WinPDB)可以提高工作效率。
更改函数:更改后必须使用
reload()
内置函数重新加载模块。我已经从 MATLAB 转向了 Python,因为我发现 Python 能够更好地处理复杂性,即我发现用 Python 编写、调试和维护复杂代码更容易。原因之一是 Python 是一种通用语言,而不是专门的矩阵操作语言。因此,像字符串、非数字数组和(至关重要的)关联数组(或映射或字典)这样的实体是 Python 中的一流构造,类也是如此。
就功能而言,使用 NumPy、SciPy 和 Matplotlib,您几乎拥有 MATLAB 开箱即用提供的整套功能,以及相当多的功能,您必须购买单独的工具箱才能使用。
IDE: No. Python IDEs are nowhere near as good or mature as MATLAB's, though I've heard good things about Wing IDE. Generally, I find IDEs to be total overkill for Python development, and find that I'm more productive with a well-setup text editor (vim in my case) and a separate visual debugger (WinPDB).
Changing functions: Modules must be reloaded after changes using the
reload()
built-in function.I've switched over myself from MATLAB to Python, because I find that Python deals much better with complexity, i.e., I find it easier to write, debug and maintain complex code in Python. One of the reasons for this is that Python is a general purpose language rather than a specialist matrix-manipulation language. Because of this, entities like strings, non-numerical arrays and (crucially) associative arrays (or maps or dictionaries) are first-class constructs in Python, as are classes.
With regards to capabilities, with NumPy, SciPy and Matplotlib, you pretty much have the whole set of functionality that MATLAB provides out of the box, and quite a lot of stuff that you would have to buy separate toolboxes for.
我在 Python(x,y) 发行版中使用 Spyder IDE 相处得很好。我是 Matlab 的长期用户,知道 Python 的存在已有 10 年左右的时间,但直到我安装了 Python(x,y) 后,我才开始定期使用 Python。
I've been getting on very well with the Spyder IDE in the Python(x,y) distribution. I'm a long term user of Matlab and have known of the existence of Python for 10 years or so but it's only since I installed Python(x,y) that I've started using Python regularly.
您可能还想查看以下线程中的一些答案,尽管它们没有解决您的两个主要问题:
我应该切换到 Python 吗?
我也是从 Matlab 彻底转换过来的:
我还没有使用过功能齐全的 Python IDE,但是在IPython 与 Matplotlib、Numpy、Scipy 等结合使用。我实际上使用 Enthough Python Distribution,它预装了我需要的大多数科学/定量包。我还听说过有关 Python(x,y) 和 Sage 的好消息
也许其他 IDE 可以处理这个问题,但在 IPython 中我使用 autoreload,效果相当好。
正如其他人所提到的,由于数值/定量库来到了 Python,而不是数值库在上面破解了一种语言,因此您拥有 Matlab 所没有的令人难以置信的灵活性。此外,Python 社区,尤其是在数值/定量领域,确实非常出色。
You might also want to check out some of the answers in the following thread, although they don't address your 2 major concerns:
Should i switch to Python?
I'm also a total convert from Matlab:
I have yet to use a full featured Python IDE, but have gotten on pretty well in IPython in combination with Matplotlib, Numpy, Scipy, etc. I actually use the Enthough Python Distribution that comes preloaded with most of the scientific/quantitative packages I need. I've also heard good things about Python(x,y) and Sage
Maybe other IDE's handle this but in IPython I use autoreload which works fairly well.
As others have mentioned, since the numerical/quantitative libraries came to Python instead of a numerical library hacking a language on top, you have an incredible amount of flexibility that you don't have with Matlab. Also the Python community, especially in the numerical/quantitative areas, is really quite fantastic.
我在工程领域工作了一段时间,一直使用 MATLAB 进行高复杂度的数学计算。我从来没有真正遇到过重大问题,但我对此也不是非常热衷。几个月前,我发现我将成为数值方法课程的助教,并且该课程将使用 Python 进行教学,因此我必须学习该语言。
我一开始以为是额外的工作,结果却是一个很棒的爱好。我什至无法描述 MATLAB 与 Python 相比有多么糟糕!过去在 Matlab 中需要花一整天的时间来编写代码,现在在 Python 中只需几个小时即可编写代码。我的代码看起来也更有吸引力。 Python 的性能和灵活性着实令我惊讶。有了 Python,我几乎可以做以前在 MATLAB 中做的任何事情,而且可以做得更好。
如果其他人正在考虑切换,我建议您这样做。这让我的生活变得轻松多了。我将引用“计算科学的 Python 脚本”,因为他们比我更好地描述了 Python 相对于 MATLAB 的优点:
I've been in the engineering field for a while now and I've always used MATLAB for high-complexity math calculations. I never really had an major problems with it, but I wasn't super enthusiastic about it either. A few months ago I found out I was going to be a TA for a numerical methods class and that it would be taught using Python, so I would have to learn the language.
What I at first thought would be extra work turned out to be an awesome hobby. I can't even begin to describe how bad MATLAB is compared to Python! What used to to take me all day to code in Matlab takes me only a few hours to write in Python. My code looks infinitely more appealing as well. Python's performance and flexibility really surprised me. With Python I can literally do anything I used to do in MATLAB and I can do it a lot better.
If anyone else is thinking about switching, I suggest you do it. It made my life a lot easier. I'll quote "Python Scripting for Computational Science" because they describe the pros of Python over MATLAB better than I do:
我们使用 Wing IDE 进行 Python 开发。它功能齐全,具有集成的调试支持,并且可以连接到您选择的分析器。
关于 (2),我确切地知道你的意思,因为我错过了 Lisp 的相同功能,而且据我所知,你需要在更改库后主动重新导入库。不过,这并不是一个真正的问题,因为您可以轻松地编写(一次)一个小函数,为您关心的每个模块执行此操作,然后将该函数放在一个关键宏上,因此您所要做的就是 例如,更改代码后按 CTRL-T。
We use the Wing IDE for Python development. It is quite well featured, has integrated debugging support, and can be connected to the profiler of your choice.
Regarding (2), I know exactly what you mean since I miss that very same feature from Lisp, and so far as I know you need to actively reimport the libraries after changing them. This isn't a real hangup, though, since you can easily write (once) a small function that does that for every module you care about, and then put that function on a key macro so all you have to do is eg hit CTRL-T after changing code.
几乎所有内容都被其他人涵盖了..我希望你不需要任何工具箱,例如优化工具箱,神经网络等..[我没有找到Python的这些工具,可能有一些..我严重怀疑它们可能比Matlab 的..]
如果你不需要符号操作能力并且使用 Windows python(x,y) 是可行的方法[他们在 Linux 端口上没有太多活动(旧版本可用)]
(或者需要一些小的符号操作,使用 sympy ,我认为它带有 EPD 和 python(x,y) 取代/集成 EPD)
如果你需要符号功能 sage 是正确的选择,恕我直言 sage 与 Matlab 以及Mathematica ..
我也在尝试进行切换...(需要我的engg projs)
我希望它有帮助..
almost everything is covered by others .. i hope you don't need any toolboxes like optimizarion toolbox , neural network etc.. [ I didn't find these for python may be there are some .. i seriously doubt they might be better than Matlab ones..]
if u don't need symbolic manipulation capability and are using windows python(x,y) is the way to go[they don't have much activity on their linux port (older versions are available)]
(or need some minor symbolic manipulations use sympy , i think it comes with EPD and python(x,y) supersedes/integrates EPD)
if you need symbolic capabilities sage is the way to go, IMHO sage stands up good with Matlab as well as Mathematica ..
i'm also trying to make a switch ...(need for my engg projs)
i hope it helps ..
经过与众多编辑长时间的尝试后,
我已经选择了 aptana ide + ipython (包括互联网浏览器中的笔记本)
非常适合编辑,轻松获得帮助,尝试快速新事物
aptana 与 eclipse 相同(因为 pydev),但是 aptana 有主题和不同的小东西 eclipse 缺少
一些关于 python 的东西,
不要忘记 pandas,因为(我相信)它是非常强大的数据分析工具
未来它将是一头野兽,我认为
我正在研究 matlab,我在那里看到了一些很棒的东西,特别是 GUI 界面和其他一些不错的东西,
但 python 给了你灵活性和易用性,
无论如何,你仍然需要学习 python、matplotlib、numpy(最终还有 pandas)的基础知识,
但从我看来,numpy 和 matplotlib 与 matplotlib 概念类似(可能它们是在考虑到 matlab 的情况下创建的,对吧?)
after long long tryouts with many editors,
i have settled for aptana ide + ipython (including notebook in internet browser)
great for editing, getting help easy, try fast new things
aptana is the same as eclipse (because of pydev) but aptana has themes and different little things eclipse lacks
about python a little,
don't forget pandas, as it's (i believe) extremely powerful tool for data analysis
it will be a beast in the future, my opinion
i'm researching matlab, and i see some neat things there, especially gui interfaces and some other nice things
but python gives you flexibility and ease,
anyway, you still have to learn the basics of python, matplotlib, numpy (and eventually pandas)
but from what i see, numpy and matplotlib are similar to matplotlib concepts (probably they were created with matlab in mind, right?)
这个问题是在 2011 年提出的。
最近,在 2013 年中期,我已经完全转向 Python,这主要是因为类似 Matlab 的 Spyder IDE 的可用性,以及整个 Scientific 的一体化安装程序蟒蛇 & IDE环境。
PythonXY(仅限 Windows)和 Continuum Analytics 的 Anaconda (Mac/Win/Linux) 让您无需配置即可在类似 matlab 的 IDE (Spyder) 中快速启动并运行,并带有变量检查器、文件资源管理器、对象检查器(显示您键入的函数的实时帮助)等等。现在它对我来说是一个完整的 Matlab 替代品。
This question was asked in 2011.
Much more recently, in mid-2013, I've been completely converted to Python, primarily due to the availability of the Matlab-like Spyder IDE, along with all-in-one installers for the entire Scientific Python & IDE environment.
PythonXY (windows only) and Continuum Analytics' Anaconda (Mac/Win/Linux) get you up and running rapidly, with no configuration, in a matlab-like IDE (Spyder), with variable inspector, file explorer, object inspector (displaying live help on the functions you type) etc. etc. It is now a full Matlab replacement for me.
人们可能会从 MATLAB 转向 Python,因为 Python 能更好地处理复杂性,即更容易编写、调试和维护复杂代码。这样做的一个充分理由是,Python 是一种通用语言,而不是矩阵操作语言。因此,非数字数组、字符串和关联数组等实体是 Python 中的一流构造。
我们经常听说人们和整个研究小组从 Matlab 过渡到 Python。科学的 Python 生态系统正在快速成熟,Python 是一个有吸引力的替代方案,因为它是免费、开源,并且变得越来越强大。让我们详细探讨一下它们。
Matlab 和 Python 的生态系统
根据定义,Python 是一种编程语言。最常见的实现是 C 语言,也称为 CPython,通常称为 Python。除了编程语言和解释器之外,Python 还包含一个广泛的标准库。该库针对一般编程,包含操作系统特定内容、线程、网络、数据库等模块。Matlab
是一种商业数值计算环境和编程语言。 Matlab的概念是指整个软件包,包括IDE。标准库不包含那么多通用编程功能,但包含矩阵代数和用于数据处理和绘图的广泛库。对于额外的功能,Mathworks 提供了工具包(但这些需要额外的费用)。
要在Python中进行科学计算,您需要额外的软件包(例如
Numpy
、Scipy
、Matplotlib
)。此外,您还需要一个IDE。许多 Python 开发者来自 Linux 环境,使用 Python shell 和编辑器(如 vi 或 Emacs),但来自 Matlab 的人更喜欢功能丰富的 IDE。现在有许多可用于 Python 的强大 IDE,例如 PyCharm 、 Spyder , Jupyter Notebook 还有更多。Python 包是由不同的(但通常是重叠的)群体开发的,他们也是这些包的用户。许多软件包可用于不同的目的。在这个开源生态系统中,大多数软件包都是由少数核心开发人员驱动的,但许多软件包用户通过报告问题、帮助编写文档以及对代码进行小幅改进来为开发做出贡献。
Matlab 的优点
让我们来看看 Matlab 的一些优点:
Simulink
是一个产品目前还没有好的替代方案。
你需要,而在Python中你需要安装额外的包和
IDE。
(尽管很少有公司有钱购买许可证)。
Matlab 的问题
这里我们并不是想让 Matlab 看起来很糟糕。我自己曾经很喜欢Matlab。然而,我认为 Matlab 有一些根本性的缺点。其中大部分源于其商业性质:
算法是专有的,这意味着您看不到代码
您正在使用的大多数算法并且必须相信它们
已正确实现。
Matlab 相当昂贵,这意味着编写的代码
Matlab只能供有足够资金购买的人使用
许可证。
自然地,Mathworks 对代码可移植性施加了限制,
能够在别人的计算机上运行您的代码。你可以运行你的
使用
Matlab 组件运行时 (MCR)
编译的应用程序,但是您的便携式应用程序必须与安装的版本完全匹配
MCR
,考虑到 Matlab 发布了新的每 6 个月更新一次版本。
专有性质也使得第三方很难扩展
Matlab 的功能。
此外,还有一些其他问题源于 Matlabs 作为矩阵操作包的起源:
控制台,但在脚本中,必须结束一行没有任何意义
带分号以抑制输出。
它与函数调用不同。
Python 的优点
Python 语言在软件开发公司中具有多样化的应用,例如游戏、Web 框架和应用程序、语言开发、原型设计、图形设计应用程序等。这使该语言比其他语言具有更多的应用性工业界使用的编程语言。在了解 Python 的一些优势之前,请先快速浏览一下此处。现在让我们看看它的一些优点 -
广泛的支持库
它提供了大型标准库,其中包括字符串等区域
操作、互联网、网络服务工具、操作系统接口和
协议。大多数常用的编程任务已经编写成脚本
它限制了用Python编写的代码的长度。
集成功能
Python 集成了企业应用程序集成,可以轻松地
通过调用 COM 或 COBRA 组件来开发 Web 服务。它具有强大的
控制功能,因为它通过 Jython 直接通过 C、C++ 或 Java 进行调用。
Python 还处理 XML 和其他标记语言,因为它可以在所有
现代操作系统通过相同的字节代码。
提高程序员的工作效率
该语言拥有广泛的支持库和简洁的面向对象设计
使程序员的工作效率提高两到十倍
Java、VB、Perl、C、C++ 和 C# 等语言。
生产力
凭借其强大的流程集成功能、单元测试框架和
增强的控制能力有助于提高大多数设备的速度
应用程序和应用程序的生产力。这是一个很好的选择
构建可扩展的多协议网络应用程序。
Python 的缺点
Python 具有多种优势特性,与其他编程语言相比,程序员更喜欢这种语言,因为它易于学习和编码。然而,这种语言仍然没有在包括企业开发商店在内的一些计算领域占据一席之地。因此,这种语言可能无法解决某些企业解决方案,其局限性包括 -
使用其他语言的困难
Python 爱好者已经习惯了它的功能和广泛的功能
图书馆,因此他们在学习或从事其他编程工作时面临问题
语言。 Python 专家可能会看到强制转换值或变量的声明
类型
,添加大括号或分号作为语法要求繁重的任务。
移动计算薄弱
Python 已经出现在许多桌面和服务器平台上,但它
被视为移动计算的弱语言。这就是极少数的原因
移动应用程序是用它构建的,就像 Carbonnelle 一样。
速度变慢
Python 在解释器而不是编译器的帮助下执行,这
导致它变慢,因为编译和执行帮助它工作
通常情况下。另一方面,可以看出对于很多网络来说速度很快
应用程序也是如此。
运行时错误
Python 语言是动态类型的,因此有很多设计限制
一些 Python 开发人员报告的。甚至可以看出,它需要
更多的测试时间,当应用程序最终完成时错误就会出现
数据库访问层不发达
与 JDBC 和 ODBC 等流行技术相比,Python 的
发现数据库访问层有点不发达和原始。
但不适用于需要流畅交互的企业
复杂的遗留数据
Python 相对于 Matlab 的优势
Python 代码比 Matlab 代码更紧凑、更容易阅读
与Matlab不同,Matlab使用end语句来指示块的结束,
Python 根据缩进确定块大小。
Python 使用方括号进行索引,使用圆括号进行函数和
方法,而 Matlab 两者都使用括号,使 Matlab 更容易
难以区分和理解。
Python 更好的可读性可以减少错误并加快调试速度。
虽然大多数编程语言(包括 Python)都使用从零开始的索引,
Matlab 使用基于 1 的索引,使用户更加困惑
虽然大多数编程语言(
Python 中的面向对象编程 (OOP) 既简单又灵活
Matlab 的 OOP 方案复杂且令人困惑
Python 是免费且开放的
虽然 Python 是开源编程,但 Matlab 的大部分内容是封闭的
Python 的开发者鼓励用户为
软件,而 Matlab 的开发人员不提供此类交互
Python 在图形包和工具集中提供了更广泛的选择
NumPy
、SciPy
和Matplotlib
,您几乎拥有 MATLAB 提供的开箱即用的整套功能,以及相当多您必须购买的东西用于单独的工具箱。然而,MatLab 社区对于选择 Matlab 或 Python,(是的,认真的)。不过读得不错。
One may switch from MATLAB to Python because Python deals much better with complexity i.e. easier to write, debug and maintain complex code. One of the good reasons for that is, Python is a general purpose language rather than a matrix-manipulation language. Because of this, entities like non-numerical arrays , strings and associative arrays are first-class constructs in Python.
We regularly hear of people and whole research groups that transition from Matlab to Python. The scientific Python ecosystem is maturing fast and Python is an appealing alternative, because it’s free, open source, and becoming ever more powerful. Let's explore of them in details.
Ecosystems of Matlab and Python
Python, by definition, is a programming language. The most common implementation is that in C also known as CPython and is what is mostly referred to as Python. Apart from the programming language and interpreter, Python also consists of an extensive standard library. This library is aimed at programming in general and contains modules for OS specific stuff, threading, networking, databases etc.
Matlab is a commercial numerical computing environment and programming language. The concept of Matlab refers to the whole package, including the IDE. The standard library does not contain as much generic programming functionality, but does include matrix algebra and an extensive library for data processing and plotting. For extra functionality the Mathworks provides toolkits (but these cose you extra).
To do scientific computing in Python, you need additional packages (e.g.
Numpy
,Scipy
,Matplotlib
). Additionally, you’ll need an IDE. Many pythoneers come from a Linux environment and use a Python shell and an editor (like vi or Emacs), but people coming from Matlab prefer a feature-rich IDE. Now today there are many handful and powerful IDE available for Python such as PyCharm , Spyder , Jupyter Notebook and many more.Python packages is being developed by a different (but often overlapping) group of people, who are also users of the packages. Many packages are available for different purposes. In this open source ecosystem most packages are driven by a handful of core developers, but many of a package users contribute to the development by reporting issues, helping with documentation, and making small improvements to the code.
Advantages of Matlab
Let's pick up some of the advantages we can get from Matlab :
Simulink
is a product for whichthere is no good alternative yet.
you need, while in Python you need to install extra packages and an
IDE.
(although few companies have the money to buy a license).
The problem with Matlab
Here we do not intend to make Matlab look bad. I used to love Matlab myself. However, i think that Matlab has a few fundamental shortcomings. Most of these arise from its commercial nature:
The algorithms are proprietary, which means you can not see the code
of most of the algorithms you are using and have to trust that they
were implemented correctly.
Matlab is quite expensive, which means that code that is written in
Matlab can only be used by people with sufficient funds to buy a
license.
Naturally, the Mathworks puts restrictions on code portability, the
ability to run your code on someone elses computer. You can run your
compiled application using the
Matlab Component Runtime (MCR)
, butyour portable app must exactly match the version of the installed
MCR
, which can be a nuisance considering that Matlab releases a newversion every 6 months.
The proprietary nature also makes it difficult for 3th parties to extend the
functionality of Matlab.
Furtheremore, there are some other issues that stem from Matlabs origins as a matrix manipulation package:
console, but in scripts it does not make any sense that one must end a line
with a semicolon in order to suppress output.
distinguish it from a function call.
Advantages of Python
The Python language has diversified application in the software development companies such as in gaming, web frameworks and applications, language development, prototyping, graphic design applications etc. This provides the language a higher plethora over other programming languages used in the industry. Before picking up some advantage of Python, just give a quick tour here. Now let's see some of the advantages of it -
Extensive Support Libraries
It provides large standard libraries that include the areas like string
operations, Internet, web service tools, operating system interfaces and
protocols. Most of the highly used programming tasks are already scripted into
it that limits the length of the codes to be written in Python.
Integration Feature
Python integrates the Enterprise Application Integration that makes it easy to
develop Web services by invoking COM or COBRA components. It has powerful
control capabilities as it calls directly through C, C++ or Java via Jython.
Python also processes XML and other markup languages as it can run on all
modern operating systems through same byte code.
Improved Programmer’s Productivity
The language has extensive support libraries and clean object-oriented designs
that increase two to ten fold of programmer’s productivity while using the
languages like Java, VB, Perl, C, C++ and C#.
Productivity
With its strong process integration features, unit testing framework and
enhanced control capabilities contribute towards the increased speed for most
applications and productivity of applications. It is a great option for
building scaleble multi-protocol network applications.
Disadvantages of Python
Python has varied advantageous features, and programmers prefer this language to other programming languages because it is easy to learn and code too. However, this language has still not made its place in some computing arenas that includes Enterprise Development Shops. Therefore, this language may not solve some of the enterprise solutions, and limitations include-
Difficulty in Using Other Languages
The Python lovers become so accustomed to its features and its extensive
libraries, so they face problem in learning or working on other programming
languages. Python experts may see the declaring of cast
values
or variabletypes
, syntactic requirements of adding curly braces or semi colons as anonerous task.
Weak in Mobile Computing
Python has made its presence on many desktop and server platforms, but it is
seen as a weak language for mobile computing. This is the reason very few
mobile applications are built in it like Carbonnelle.
Gets Slow in Speed
Python executes with the help of an interpreter instead of the compiler, which
causes it to slow down because compilation and execution help it to work
normally. On the other hand, it can be seen that it is fast for many web
applications too.
Run-time Errors
The Python language is dynamically typed so it has many design restrictions
that are reported by some Python developers. It is even seen that it requires
more testing time, and the errors show up when the applications are finally
run.
Underdeveloped Database Access Layers
As compared to the popular technologies like JDBC and ODBC, the Python’s
database access layer is found to be bit underdeveloped and primitive.
However, it cannot be applied in the enterprises that need smooth interaction
of complex legacy data
Advantages of Python over Matlab
Python code is more compact and easier to read than Matlab code
Unlike Matlab, which uses end statement to indicate the end of a block,
Python determines block size based on indentation.
Python uses square brackets for indexing and parentheses for functions and
methods, whereas Matlab uses parentheses for both, making Matlab more
difficult to differentiate and understand.
Python’s better readability leads to fewer bugs and faster debugging.
While most programming languages, including Python, use zero-based indexing,
Matlab uses one-based indexing making it more confusing for users to
translate.
The object-oriented programming (OOP) in Python is simple flexibility while
Matlab's OOP scheme is complex and confusing
Python is free and open
While Python is open source programming, much of Matlab is closed
The developers of Python encourage users to input suggestions for the
software, while the developers of Matlab offer no such interaction
Python offers a wider set of choices in graphics package and toolsets
With
NumPy
,SciPy
andMatplotlib
, you pretty much have the whole set of functionality that MATLAB provides out of the box, and quite a lot of stuff that you'd have to buy for separate toolboxes.However, MatLab community has their own arguments to choose Matlab or Python, (yes seriously). Good reading though.
关于 IDE 问题,请查看 What IDE to use for Python?,其中最重要的答案是 PyDev 使用 Eclipse。
我还认为 Sage 可能值得一看
Concerning the IDE question, have look at What IDE to use for Python?, where the top answer is PyDev which uses Eclipse.
I also think Sage might be worth looking at
我最近从 MATLAB 切换到 Python(转换大约 2 个月),并且使用 Sublime Text 2 进展得相当好,使用 SublimeRope 和 SublimeLinter 插件提供一些类似 IDE 的功能,以及 pudb 提供一些图形交互调试功能。
我还没有探索过分析器或变量编辑器。 (无论如何,我从未真正使用过 MATLAB 变量编辑器)。
I have recently switched from MATLAB to Python (I am about 2 months into the transition), and am getting on fairly well using Sublime Text 2, using the SublimeRope and SublimeLinter plugins to provide some IDE-like capabilities, as well as pudb to provide some graphical interactive debugging capabilities.
I have not yet explored profilers or variable editors. (I never really used the MATLAB variable editor, anyway).