• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Learning Python together

Maybe we can do something about that together. Something like install Python on our machine and post simple Python exercises weekly so everyone can learn together.
Andy, sounds like a great idea. Would like to contribute. I recently held four lectures at the Saarland University, Germany, about numerical methods in mathematical finance (see NumFinWS0910 - DEXISION Wiki). The lecture notes are in German but the scripts (for European options, American options, calibration of jump diffusion model, etc.) contain English comments. Scripts are rather simple (no object orientation in it) so everyone with some programming background should grasp the ideas quickly.

What do you think?
 
Andy, seems to be the right route to take. The scripts from my lectures have been for illustrating finance with Python - not to teach Python in the first place. So some introductory scripting exercises are probably in order. Of course, one should have the finance setting in mind and include, e.g., NumPy syntax from the beginning.
 
If you guys are looking of some excellent but not necessarily finance oriented exercises, I would highly recommend working through the problems on Project Euler.

You can concentrate on financial applications of Python but at the same time working through those problems sequentially as 'problems of the week' might both fun and educational.
 
Nice find, Sanket.
Those look like fun and interesting to code together.
Any hiccup getting numpy, scipy on Ubuntu 9.10?

None at all; both numpy and scipy are available through the Synaptics Package Manger.
 
Just downloaded 2.6.


Got these two books also :



Need to finish my midterm studying and then start cracking down on this. ;)


Maybe I can put the exercises from the books?

---------- Post added at 06:26 PM ---------- Previous post was at 06:19 PM ----------

Exercise 1.1. Compute 1+1.
The first exercise concerns some basic mathematics: Write a
Python program for printing the result of 1+1. Name of program file:
1plus1.py.

Exercise 1.2. Write a “Hello, World!” program.
Almost all books about programming languages start with a very
simple program that prints the text “Hello,World!”to the screen. Make
such a program in Python. Name of program file: hello_world.py.

Exercise 1.3. Convert from meters to British length units.
Make a program where you set a length given in meters and then
compute and write out the corresponding length measured in inches,
in feet, in yards, and in miles. Use that one inch is 2.54 cm, one foot is
12 inches, one yard is 3 feet, and one British mile is 1760 yards. As a
verification, a length of 640 meters corresponds to 25196.85 inches,
2099.74 feet, 699.91 yards, or 0.3977 miles. Name of program file:
length_conversion.py.

Exercise 1.4. Compute the mass of various substances.
The density of a substance is defined as ̺ = m/V , where m is the
mass of a volume V . Compute and print out the mass of one liter of
each of the following substances whose densities in g/cm3 are found
in the file src/files/densities.dat: iron, air, gasoline, ice, the human
body, silver, and platinum: 21.4. Name of program file: 1liter.py. ⋄

Exercise 1.5. Compute the growth of money in a bank.
Let p be a bank’s interest rate in percent per year. An initial amount
A has then grown to


A(1+p/100)^n


after n years. Make a program for computing how much money 1000
euros have grown to after three years with 5% interest rate. Name of
program file: interest_rate.py.


These are the first 5 exercises from the Primer book on Python I have.
 
2.6
Don't play with the bleeding edge. It will cut you somehow.

I've been using 3 for sometime and I haven't really run into any major issues. The one thing I find very annoying, especially with Eclipse, is that if I the 3 as the interpreter, Eclipse gives a warning for the following statement:

C++:
print 'foo'

However, I don't see any warnings if I use following print statement:

C++:
print ('foo')

I'm not sure if this a result of a difference between 2.6 and 3.x or just something within Eclipse.
 
Just downloaded 2.6.


Got these two books also :


I really like the Summerfield book; that book was my first foray into Python. I still haven't finished reading the book though :)

I read the first half of the book and after that I've been relying on Google; though I suppose I should probably finish the book one of these days...
 
okay, Windows Vista 64bit sucks.

I am really liking Python. Went through a few exercises. It's pretty cool.

I still think MATLAB is the best if you have all the toolboxes and I do.
 
Back
Top