MATLAB and Python are both rather popular languages. Real Python has an overview of the two with an eye towards encouraging use of Python. There is a lot to say when comparing languages, so this is a long read.
MATLABĀ® is widely known as a high-quality environment for any work that involves arrays, matrices, or linear algebra. Python is newer to this arena but is becoming increasingly popular for similar tasks. As you’ll see in this article, Python has all of the computational power of MATLAB for science tasks and makes it fast and easy to develop robust applications. However, there are some important differences when comparing MATLAB vs Python that you’ll need to learn about to effectively switch over.
In this article, you’ll learn how to:
- Evaluate the differences of using MATLAB vs Python
- Set up an environment for Python that duplicates the majority of MATLAB functions
- Convert scripts from MATLAB to Python
- Avoid common issues you might have when switching from MATLAB to Python
- Write code that looks and feels like Python
Earlier on SN:
Python's Guido van Rossum Steps Down (2018)
What's Today's Top Language? Python... no, Wait, Java... no, C (2017)
GNU Octave - Open Source Answer to Matlab - Hits 4.0.0 (2015)
You Want MatLab on Your Resume to Get a Job at Google (2014)
Why Python is Slow: Looking Under the Hood (2014)
(Score: 2) by corey on Thursday September 12 2019, @07:48AM (8 children)
Just reading through it and it goes into using Anaconda and conda and then IDEs and all this other junk.
When I used to write in python, it was make a text file in whatever editor and then python blah.py
I guess now everyone and his dog are pythonistas, judging by all the ads on LinkedIn and online courses and blah blah.
(Score: 3, Interesting) by corey on Thursday September 12 2019, @08:00AM
Forgot to mention, despite my criticism above, the article is pretty good in achieving its aims.
(Score: 2) by Freeman on Thursday September 12 2019, @03:04PM (4 children)
You can still use notepad++ / notepad, then do python blah.py to run your program, but you're missing out on some very nice things. I went hunting for a decent IDE for Python a couple years ago and settled on PyCharm. It has a dark color theme, syntax highlighting, auto-indentation, code completion (auto-complete for code), and a few more bells and whistles. You get all that in the free community edition. You can also upgrade to the professional version for a few extra bells and whistles that are much more useful for large productions. As far as I remember, the professional edition, isn't obscenely expensive, either.
Joshua 1:9 "Be strong and of a good courage; be not afraid, neither be thou dismayed: for the Lord thy God is with thee"
(Score: 2) by Freeman on Thursday September 12 2019, @03:08PM (1 child)
Ahh.., I forgot to mention, projects. It's easy to be working on multiple projects, with multiple versions of python, and various packages when using something like PyCharm. It just makes your life easier, so you can get to coding, instead of managing your code / project.
Joshua 1:9 "Be strong and of a good courage; be not afraid, neither be thou dismayed: for the Lord thy God is with thee"
(Score: 2) by corey on Thursday September 12 2019, @10:54PM
Thanks, that sounds like a good reason to use an ide.
(Score: 2) by toddestan on Friday September 13 2019, @01:49AM (1 child)
PyCharm can be a bit overwhelming for new users. One of the things I see people who are trying to learn Python and jump into PyCharm struggle with is how PyCharm sets up all kinds of virtual environments behind the scenes with every project, and if you aren't used to Python's versioning headaches then you may not know what it is doing, or why.
The other issue I had with PyCharm is that it is written in Java and the performance is about what you would expect. Though today with 8 cores and 32 GB of ram, it may not matter.
If you are used to Matlab, Spyder is probably a better choice.
(Score: 2) by Freeman on Friday September 13 2019, @02:25PM
Spyder+Anaconda is definitely geared towards the same things as MATLAB. Yet, Python is much more popular and has better community support. Spyder's home page shows off their white theme, which leaves much to be desired. Also, you essentially need to use their Spyder+Anaconda package. I prefer sticking with plain-old Python with a decent IDE. Thus, why I settled on using PyCharm. I may have made a different decision, if I was using Python strictly as a Scientific tool.
Joshua 1:9 "Be strong and of a good courage; be not afraid, neither be thou dismayed: for the Lord thy God is with thee"
(Score: 2) by Thexalon on Thursday September 12 2019, @03:39PM (1 child)
Emacs is the closest thing to an IDE I've used in ages. Whether we're talking Python or other languages.
I understand why they use IDEs in articles like this though: A lot of programmers not only like them but also think that means their language is "modern", whatever that means.
The only thing that stops a bad guy with a compiler is a good guy with a compiler.
(Score: 2) by sgleysti on Thursday September 12 2019, @11:48PM
Good support for structured programming ;)