Between #Matlab and #Python, which one would you recommend to learn, for a student who wants to learn programming (from scratch) to do data analysis? And why?
I am conflicted because I think Matlab is maybe slightly more straightforward to learn, but Python should be more useful in the long term (I know both and need to decide which one to teach my student).
I think answers might differ depending on whether you're in academia or not so I'm also asking about your occupation in the poll:
#Academia #AcademicChatter #Coding #Programming #Neuroscience (in this case)
- I recommend Matlab (as an academic) (1%, 3 votes)
- I recommend Python (as an academic) (54%, 90 votes)
- I recommend Matlab (as a non-academic) (0%, 1 vote)
- I recommend Python (as a non-academic) (38%, 63 votes)
- don't know / see results (4%, 7 votes)
This entry was edited (1 day ago)

Neil
in reply to El Duvelle • • •Matlab is proprietary and requires a license, you may learn it but when you leave a place where they provide you with a license you will have to fork out for that yourself.
Python, R, Julia and many others (even the classic UNIX tools) are all Free Open Source Software that you can learn and take the knowledge with you anywhere, knowing that you will be able to use the tools in any setting.
Pozorvlak
in reply to Neil • • •numerical computation software
Contributors to Wikimedia projects (Wikimedia Foundation, Inc.)Neil
in reply to Pozorvlak • • •@pozorvlak Ta, I was vaguely aware there was a GNU version but couldn't remember its name.
If not all libraries/packages are supported though then that is a potential risk.
I started with Stata many years ago and liked it but moved to R for the more open-source nature and not having to buy licenses.
El Duvelle
in reply to Neil • • •@nshephard @pozorvlak
Yes.. I tried to use Octave some time ago and it was not ideal, it had some problems compared to Matlab. But maybe that's improved now?
This is a bit out of topic but can you do the same things in R as with Python? I thought it was just specific to statistics.
Neil
in reply to El Duvelle • • •@pozorvlak Python v R, depends what you want to do but most things can be achieved in both.
Start with one and if you need something in the other learn that.
You can call Python functions from R using the `reticulate` package if rstudio.github.io/reticulate/ and you can call R from Python using `rpy2` rpy2.github.io/doc/latest/html…
Understand you won't ever know everything about either (or any) language and see it from the perspective as a journey of continual learning and you'll go far.
Interface to Python
rstudio.github.ioNeil
in reply to Neil • • •@pozorvlak R probably has more breadth in specific statistical modelling, it tends to be favoured by Statisticians, whilst Python is a more general language and tends to be favoured by those with Computer Science background.
Both are great and have supportive communities.
This is a good community dslc.io
dslc.io
dslc.ioNeil
in reply to Neil • • •@pozorvlak One more thought from me..
You'll need a tool to learn your programming in, again avoid proprietary tools (e.g. VSCode, PyCharm).
My recommendation would be to learn #Emacs, its FOSS, has a great user community and is endlessly configurable to suit your needs (beware the 🐰 🕳️ ) but it has the potential to massively improve your productivity.
Pozorvlak
in reply to Neil • • •El Duvelle
in reply to Pozorvlak • • •Hmm, in that case I'm thinking more of Spyder or an equivalent (for Python). The Matlab IDE is great (easy to use, convenient for debugging) so something that looks as similar to that would be ideal. We want to have the least possible friction so that the student can focus on the programming language.
Neil
in reply to El Duvelle • • •minimal friction is a good, can't speak for Spyder as I've never used it.
However, we do learn when there is friction, its why using LLMs to solve programming problems means we don't learn. Depends how much time the student has to go up that learning curve.
Couple of decent things I read on this recently...
datavizf25.classes.andrewheiss…
skybert.net/aifail/dont-fear-t…
Week 15 FAQs – Data Visualization with R
Data Visualization with RChristian Rickert
in reply to El Duvelle • • •It depends on your projects, really.
If you have to build upon or maintain existing (Matlab) code, then you don't have a choice.
Matlab is a commercial product and you have to buy a license to be able to even run or compile your code.
If you want to learn programming with a new project, Python is a good choice.
Python is open-source and always free and evolving. Code is backwards compatible and easy to run.
El Duvelle
in reply to Christian Rickert • • •@christianrickert True, and in this case we do not particularly need to rely on existing code so Python might seem the most appropriate.
However, I have had very bad experiences with python code becoming broken due to not having the exact version of some dependencies, even Spyder not working because I had to use specific versions of some of its dependencies because the code needs a specific version. Some Python code I'm using at the moment is currently stuck in the past because I know that if I update one module everything will break..
So I am not sure we can say that Python is really backwards-compatible. I think Matlab actually deals with this a bit better...
Christian Rickert
in reply to El Duvelle • • •Python is moving quickly into "containerizing" with environments.
All my projects use `venv` or `uv` to create independent installations with different Python and package versions.
Under macOS you can use Homebrew, with Linux the package manager, and Windows just got `py` (install Python3.14 via `winget`) to manage Python versions.
El Duvelle
in reply to Christian Rickert • • •Christian Rickert
in reply to El Duvelle • • •Christian Rickert
in reply to Christian Rickert • • •One more comment on the learning aspect:
Start with a simple text editor with syntax highlighting. If something breaks, you can ask an LLM of your choice how to fix it - you'll learn quickly.
If you use an IDE with AI code autocomplete, your code might eventually work - but you'll not understand how or why.
El Duvelle
in reply to Christian Rickert • • •Christian Rickert
in reply to El Duvelle • • •You can always ask for a link to the documentation!
El Duvelle
in reply to Christian Rickert • • •Hmm, I don't see the point of using an entire LLM program (which is bad both environmentally and ethically) just to ask for a link to the documentation that you could get by... going to the documentation?
Pozorvlak
in reply to El Duvelle • • •El Duvelle
in reply to Pozorvlak • • •@pozorvlak
Can I ask what you find weird in Matlab compared to Python? I used to think that Python was more intuitive, but then I had to do some more Matlab for a while and now I find it more difficult to code in Python. So I think a lot of the 'intuitive' aspect is just due to our own experience..
I guess for object-oriented programming Python is better (although Matlab can do it to some extent)? But these considerations are probably not relevant in this case where the student will (for now) do quite basic programming...
Pozorvlak
in reply to El Duvelle • • •El Duvelle
in reply to Pozorvlak • • •Pozorvlak
in reply to El Duvelle • • •El Duvelle
in reply to Pozorvlak • • •I don't find it to be a problem personally but it's probably confusing if you're not aware of it in the first place!
Lesley Lai
in reply to El Duvelle • • •> who wants to learn programming (from scratch) to do data analysis
I think Python (and also R and Julia) is much more prevalent in the data science field than Matlab. There are certain engineering and applied math field, where Matlab probably still provide an ecosystem advantage, but I don't think data science is one of them.
Besides, Matlab is also not great on a lot of fronts. Being a proprietary language that requires a license is one, and its poor language design is another.
El Duvelle
in reply to Lesley Lai • • •@lesley Definitely, the proprietary aspect is not great.
Why do you think it has poor language design, and does that have any influence on an average user? Having tried both I find some things to be annoying with both Python or Matlab..
Lesley Lai
in reply to El Duvelle • • •El Duvelle
in reply to Lesley Lai • • •janet (she/her)
in reply to El Duvelle • • •Sensitive content
El Duvelle
in reply to janet (she/her) • • •Sensitive content
@janet_catcus I'm definitely curious to know more about Julia, why do people prefer it say, over Python?
In this case though I have to pick between the two languages that I know already, because I'll be the one guiding the student.
Von Javi
in reply to El Duvelle • • •Sky-haired Miranda 💙🐙
in reply to El Duvelle • • •Programming? Python. Matlab is a complete language with a rich environment, but in some ways it's more designed like a maths software than a general purpose language. Things like basic algorithms and data structure can surely be taught and learnt decently using both, but if the goal is to learn programming in general, starting with Python will open infinitely more doors, and avoid a few of Matlab's limitations, quirks and bad habits (stuff like indexing starting with 1, etc.).
Besides, Matlab is on a downwards slope and has been for a while, even for its "traditional" uses. Even when I was in academia a few years ago, I sometimes had to work with Matlab, but it was either 1) large legacy projects everyone wished were rewritten in something else (often Python) but nobody had the ressources to or 2) the work of someone - generally not a computer scientist - who only knew Matlab. I can't recall anybody actually starting to create something and deliberately choose to use Matlab over other possible options.
Atle 🧇🧅
in reply to El Duvelle • • •Atle 🧇🧅
in reply to Atle 🧇🧅 • • •the reasons?
1. Open vs proprietary
2. Ease of installation
3. Usefulness in the broader world
4. Matlab beeing quirky (1-indexed)
5. Availability of learning resources
El Duvelle
in reply to Atle 🧇🧅 • • •@atlefren thanks for the input!
I'll play devil's advocate a little bit, I agree with most of your points except the install: Matlab just works, Python requires you to choose an IDE and install that separately (unless you want to use IDLE which is quite limited) + installing python modules & keeping all versions compatible between them can be a mess.
Also, in terms of learning resources, Matlab has great courses (e.g. here) , and there is a specific "Matlab for Neuroscientists" book that we give to all students. For python, there are actually so many tutorials out there that it is difficult to know which one to use..
Self-Paced Online Courses - MATLAB & Simulink
matlabacademy.mathworks.comAtle 🧇🧅
in reply to El Duvelle • • •it might be that the Matlab install has improved over the last 20 years. But nevertheless, point 1 is the main one.
Should a university provide a course in how to use a commercial product, or should they teach programming concepts using an open language?
El Duvelle
in reply to Atle 🧇🧅 • • •@atlefren yeah, I am actually disappointed more and more every day with the role of universities in this. In my (UK) university, all the computers are Windows, we are basically forced to use Teams, One Drive, Outlook and the office suite, EndNote as a reference manager.. ALL proprietary & expensive tools. Try to install Linux and our IT is in panic.
On the plus side, some of the psychology researchers use R so not all hope is lost..
I guess playing my part and teaching Python to my students would be a positive step forward in this giant mess..
Tanners
in reply to El Duvelle • • •Being able to choose an IDE and not having to use the default Matlab IDE is a pro, not a con, in my opinion. Just tell your students to use VS code (some FOSS purist will disagree, but your project is about teaching not license philosophy). Use venvs, and maybe even uv, then all will be fine.
🇨🇦
in reply to El Duvelle • • •El Duvelle
in reply to 🇨🇦 • • •@notveryhandsome Yes, I've used #Anaconda in the past and it was doing the job, although it was a bit bulky and I had sometimes problems when updating modules... Just checked again, it seems they have now added an "AI assistant" to it... so I'll probably look for something else this time.
source: anaconda.com/pricing
Pricing for Individuals and Organizations | Anaconda
Anaconda🌅 Aurore, la trans-parente 🤱
in reply to El Duvelle • • •El Duvelle
in reply to 🌅 Aurore, la trans-parente 🤱 • • •Henry
in reply to El Duvelle • • •I used MatLab at university and even wrote my dissertation project in it. In the 20 years since I've graduated I've not used it once. I've used R a bit, but mostly Python for my Data Analyst and Data Science jobs, in an engineering field.
My employer does have MatLab, but I think they're moving away from it, mostly because the licensing and version management (and the licensing of the different versions) is difficult and expensive. I've certainly not seen anyone start any projects in the last ten years with it.
Python versioning and environments is a bit of a pain, and I believe R is somewhat better, but tools like UV are making it better. If you're just starting out and using just the (many!) standard modules that come with Python, you can leave worrying about version management of external dependencies a little later.
I think for many businesses the MatLab simulation modules and extras are quite useful, especially if you're a smaller business, as they can be very industry specific and specialised - but cost extra again, and can get pretty expensive.
El Duvelle
in reply to Henry • • •Henry
in reply to El Duvelle • • •UV is a recent tool for managing Python packages, environments etc. it's made some serious improvements on a lot of the historic complaints people have had about Python version and package management.
docs.astral.sh/uv/
But I wouldn't worry about that if you're just starting, Python comes with a large built-in collection of packages that is more than enough for learning the ropes.
uv
Astral DocsEl Duvelle
in reply to Henry • • •Well, my student is starting but I've been using Python on / off for decades now, so knowing what are the currently preferred tools for it is always good :)
Szymon Bęczkowski
in reply to El Duvelle • • •As an academic I recommend Julia. It is a super nice to write language with a great package manager (this really matters!). Add to this Makie for a great plotting experience.
TBH you will probably need some Python experience at some point because it is so common.
Geoffrey Adams
in reply to El Duvelle • • •Shauna GM
in reply to El Duvelle • • •Matlab was actually my very first language. I haven't used it since I left academia though, whereas I've become a Python expert.
Packaging/install is absolutely the achilles heel of Python but it's otherwise a fantastic language and I think it's worth pushing through setup struggles. I also think the reach and community of Python both within and outside academia dwarfs Matlab and makes it the better choice even if the language itself is better to learn (a big 'if')
Geoff 🏴
in reply to El Duvelle • • •Matlab: better for numerical analysis, data handling etc.
Python: Not as good at the above (although still very useful), but with far broader applications.
If it's their first go at programming, Python, it's more widely applicable and it'll be easier to get to grips with Matlab if they know Python, rather than Python if they know Matlab.
jonny (good kind)
in reply to El Duvelle • • •Vincent Prevosto
in reply to El Duvelle • • •* Intuitive interface, all integrated (files, terminal editor)
* No need for virtual environments
* No juggling package versions that conflict and break
* Debugging works right off the bat. You can put a breakpoint in a code file at any time, even calling that function from the terminal and it works
* Figures are natively interactive. You can easily plot additional data, look at values.
* Data values are all easily accessed and displayed
And I could go on.
Python is great for many things, but not just for quickly understanding and analyzing data.
El Duvelle
in reply to Vincent Prevosto • • •Agreed! Maybe with the right IDE we can have most of these things in Python too?
Raptor
in reply to El Duvelle • • •@100vint yes, pycharm pro w/ the R plugin is what we use
jetbrains.com/pycharm/
plugins.jetbrains.com/plugin/6…
R Language - IntelliJ IDEs Plugin | Marketplace
JetBrains MarketplaceEl Duvelle
in reply to Raptor • • •Ugh, why do they have to put an "AI-assistant" everywhere these days?? Do you have the option to deactivate this in Pycharm?
Raptor
in reply to El Duvelle • • •Meph
in reply to El Duvelle • • •Academia viewpoint here:
Go the python way.
Its also easy to learn and your students will benefit on the long run.
Had to use Matlab during study, but could never re-use it afterwards.
Self-trained python and use it now for a lot of things.
Data analysis, data visualisation.
I even created a package (qrcite) to automatically generate qr codes for a set of references, to use them in my presentation.
El Duvelle
in reply to Meph • • •Meph
in reply to El Duvelle • • •thanks.
Yes, I think this is the way to go. People, will make photos of your slides anyway. So you can let them access your references (and your papers) more easily.
David Zaslavsky
in reply to El Duvelle • • •I used to be an academic but currently am not, so I voted as a non-academic, but idk 🤷
Anyway, I am definitely on the Python side because it's so much more widely used and easier to extend with packages. Plus it can do so much more than just numerical analysis. Almost every time I used Matlab in my days as an academic, I wished I could be using Python instead. It is true that Python can be less convenient, but I think the flexibility makes it worthwhile, and it's really not much more difficult if you learn how to work with it properly.
I would probably recommend Jupyter Lab as a frontend. Specifically: make a virtual environment (perhaps with pipx or uvx), install jupyter, install the extension that lets you pip install packages from within the Jupyter web UI, and that's all the messing around with venvs and CLI commands that you need to get started.
pglpm
in reply to El Duvelle • • •