Python for MATLAB users
The information below is for the workshop given in 2014.
Welcome to this workshop on Python programming intended for researchers familiar with MATLAB. The course includes basic as well as advanced topics in Python programming. No previous knowledge in Python is necessary. The course will take place at KTH, Stockholm and is free of charge.
The course includes the following basic topics:
- Numerical computation with NumPy, SciPy and matplotlib
- Using the IPython notebook
- Object oriented programming in Python
- Testing numerical code with unit tests
We will also attempt to cover the following more advanced topics:
The workshop will take place 20–21 November at KTH. We will meet in D4448 on Thursday morning at 09:15.
Thursday 20 November
09:15-11:45, Lecture in D4448
13:15-16:00, Exercises in Seminar room Faxén, in the mechanics building
Friday 21 November
09:15-11:45, Lecture in seminar room 3424, in the math building
13:15-16:00, Exercises in seminar room 3424, in the math building
Please contact the lecturer Olivier Verdier for further information.
Before attending the course, you should install Python for scientific computing, in order to be able to do the exercises. Please install Python from the anaconda distribution.
You can then check that the installation works properly by following these steps:
- Fire up a terminal, and issue the following command:
~/anaconda/bin/ipython notebook --pylab=inline
- You should now be in an IPython session in your favorite web browser. Press the “New Notebook” button.
- You should now be inside a notebook. Choose the first cell, and paste the following code:
for i in range(5): plot(cumsum(randint(2, size=1000) - .5), alpha=.7)
Now press Shift+return.
You should see a graph appearing in the cell, just below the Python code you just entered.
If this doesn’t work: write the following in the beginning of the notebook, run that cell with Shift-Enter, and repeat the test above.
%pylab %matplotlib inline
Please contact me if any of those steps do not work as expected.