I've got some experience with Python and MATLAB (through my school). Being the newb that I am, my favorite part of MATLAB is that it shows me all the variables and what's in them on the side, so if the wrong thing is going to the wrong place, I'll know at once.
That's more of an IDE feature than a language feature, if I'm understanding correctly, so if you use the right IDE, sure, the thing I understand about Matlab is that it locks you into their IDE
emacs Matlab'er reporting in as well. It's a much better experience from emacs than mathworks' bloated java gui, but sometimes their line-by-line debugging tools are pretty nice.
Check out Spyder, it has a built in console and does what you want out of the box. You can get it and a full Python install ready for most scientific and engineering uses by installing Anaconda.
It's not my favorite editor, that'd be sublime text but it requires a bit more know-how and set up than Spyder.
Can sublime show pandas dataframes in a nice visual format like spyder does? I'm a beginner and from watching YouTube videos it feels like spyder isn't as good at the intellisense type stuff but I really like the visualisation of dataframes that it does
Don't know since nearly all my pandas experience comes from using xarray (which is pandas adjacent). I don't have a variable explorer for sublime text, and I don't see that anyone has built one but it is possible. There is a pandas syntax plug in but I'm not sure what it does.
you technically dont even need an IDE to do what youre describing.
In your script place import pdb; pdb.set_trace() at any point to pause execution and drop you down into a python shell. Then use break /foo/bar.py:55 to place an additional breakpoint at line 55 in the file /foo/bar.py if need be, then do print(locals())or better yet pp locals() (pretty print) to look at all your variables.
There's not a GUI interface for it available out-of-the-box that I can think of, but you can access that information via code - and there are Python IDEs that will display it MATLAB-style.
Spyder and pycharm have that ability. I remember wanting this as well when I moved from matlab to python. But i rarely find myself looking at variables in the viewer anymore (except for structs, that is useful when autocompete is not working for some reason). I find that showing data as plots or images is more useful on both matlab and python.
In python you can find out any types by doing `print(type(variable))` but most devs usually know what is supposed to be in there before they are going to make a mistake. Like for data analytics I look at the inputs first before I do anything in python just to know what I need to do and then do it. My IDE doesn't need to say anything.
17
u/stoirtap Aug 05 '19
Hi, Engineering newb here.
I've got some experience with Python and MATLAB (through my school). Being the newb that I am, my favorite part of MATLAB is that it shows me all the variables and what's in them on the side, so if the wrong thing is going to the wrong place, I'll know at once.
Does Python have something like that?