r/Python • • Aug 05 '19

Python's response to MATLAB

Post image
4.3k Upvotes

372 comments sorted by

View all comments

60

u/Antouziast Aug 05 '19

Young engineer here, PhD student. I have to say Matlab is an awesome tool when it comes to manipulating and exploring data really fast but now I'd love to expand my programming skills and turn towards Python. But on my day to day work it's really hard to branch out since a lot of my tools are written in Matlab.

Also, one of the biggest issues I've encountered with trying to learn Python is how to set up your environment and workflow before even writing a single line of code. I've looked into conda and all but it takes some energy to find the good ressources that will help when you've never used anything else than Matlab which just works out of the box. (Any awesome tutorial to give good practices as to the management of a project in and around the code? i.e. "I'm going to start a project xyz, what's a good practice to manage my code and dependencies in a not cluttery way so that I can start working on the code and not fighting bugs?")

But in the long run I hope to rely more and more on Python than on Matlab!

TL;DR : I'm a Matlab user that wants to avoid the mistakes you do at the beginning when learning Python

3

u/el_beso_negro Aug 06 '19

Anaconda + the conda cheatsheet + Sublime.

Use the cheatsheet to help you make new environments for projects.

Another option is to use Pycharm (paid or free) then on the settings page go to Project Interpreter and create environments for each project using the GUI.

I find Anaconda to be better at managing multiple environments but Pycharm uses virtualenv which is also pretty good.

Use these environments to install the packages you require for a project and therefore you can be more organized with your work instead of having everything installed on the base environment.

Given that money has been brought up so many times in this thread against Matlab I would make a similar argument against paying someone to teach you this stuff. Just learn it from youtube and you'll be fine. If you can't figure it out from youtube then honestly maybe it's not the activity for you.

2

u/Antouziast Aug 06 '19

I agree, I learned Matlab by just doing, I don't want to pay for classes for learning Python either.

Oh so you cannot streamline Anaconda and Pycharm?

Am I wrong to say that if you use Anaconda then your workflow is basically : Some text editor + Command Line ? That would suck if you need debugging functionalities

2

u/el_beso_negro Aug 06 '19

Yes you definitely can use Anaconda environments with Pycharm but the integration is a little sucky at this point.

You can even create new conda envs right from Pycharm but in order for you to activate these envs in the terminal you need to go to the "Terminal" setting and add a reference to where the scripts.bat file is at (I don't have my PC on hand to confirm if this is the right file but I found the answer on Stackoverflow).

This is not necessary if you create new envs using virtualenv that is built in to Pycharm. The terminal already activates the env that is associated with the interpreter settings.

You can also have Pycharm look like Sublime by using the Monokai color palette which is beautiful. However you need to pay for JS, HTML, CSS support.