Friday 10 June 2016

Python and programming

When I started my Master's degree in 2014 I knew how to program in MATLAB. My supervisor suggested that I learnt OriginLab to process my data and make pretty graphs so I did. It took me several weeks to get the IT department to find who had the license keys to the university's distribution of OriginLab.
And after spending a year using OriginLab on a university PC (very slow machine) and being enormously frustrated at it eating all the RAM of the computer I decided to stop using proprietary softwares for my data handling. That meant scrapping MATLAB as well.

I had taken a half-day workshop in Python and knew that it was fairly similar to MATLAB in the basic data handling and plotting functionality. So after finishing my Master's degree I was waiting for my visa for going back to New Zealand for my PhD and decided to take a 10 week online course at edX from MITx in computer science using python. It was really good and I learnt to handle python pretty well. I've also heard great things about Codecademy from fellow PhD students.

I have since been doing all of my programming in python and I am very happy with my decision to learn it. I no longer have to worry about licenses or compatibility between operating systems.

Up until now I have mainly used Spyder for my python programming. It is a great way to convert from MATLAB to python, as it is built basically the same way. It also comes with almost all packages pre-installed and it is pretty much plug-and-play. If you are not used to using the terminal Spyder is a great choice. This week at a workshop run by MESA I was introduced to Atom and running scripts from the terminal. I think Atom is a much better code editor than the Spyder editor so I will be migrating over to Atom over the coming weeks. I will also take to opportunity to rewrite all of my scripts from python 2 to python 3. No major changes required, but it should be done.

If you are considering changing from programming in MATLAB to python, I definitely recommend it. It has an enormous amount of packages, and many people develop machine communication protocols in python (very useful for automatic experiment monitoring). Python has a very active community. Every time I have encountered a problem it is usually solved within a few minutes by typing in the package name or error message into Google.

No comments:

Post a Comment