• 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!

python-devel

Joined
12/12/12
Messages
38
Points
18
Hi Everyone,

I just started using python today, so it may be a very basic question.

I tried to install NumPy for Linux, but the system is saying I need python-dev or python-devel.

Any idea where I could get that and how to install that?

Appreciate the help.
 
The one which comes by default with ubuntu 12.X

Edit: not very sure which version of python though.

Edit 2: Some googling gave "sudo apt-get install python-dev" and it started installing python2.7-dev. Thanks anyway.
 
If you are after a specific version of NumPy (say, for a particular new feature) then you have to be careful about using the pre-built binaries such as python-numpy. Otherwise, it is probably the easiest way.

You might also want to look into pip/virtualenv, as they will help you setup separate Python environments so that various projects don't clash!
 
Thanks alain and quantstart!

The way i did it:
First installed python-dev
Extracted NumPt to a local folder. Ran the setup.py file in that folder.

I hope the binaries required for NumPy to work properly would be included in the python-dev package. Am I correct?
 
Yes, it should be fine. But you have to bear in mind that those binaries are built against a specific version of NumPy, and new releases of NumPy are made often.

The pre-built binaries should be absolutely fine for nearly everything you want to do though!

Out of interest, what are you thinking of creating with NumPy?
 
Out of interest, what are you thinking of creating with NumPy?

Nothing fancy! Mathematical manipulations of matrices. Since I am new, I am not fully aware of all functionalities of NumPy. Also I found the lack of datastructure for matrices (edit: Python minus NumPy) a bit weird! May be users become used to as they get along.
 
Well, it depends what you mean by "data structures". There is the simple array structure, which can handle matrices (tensors of rank 2) and above. If you are referring to banded, block or sparse matrices, for instance, then you also have these sub-libraries:
http://docs.scipy.org/doc/scipy/reference/linalg.html
http://docs.scipy.org/doc/scipy/reference/sparse.html

As it happens I've written a few tutorials on matrix algorithms with NumPy/SciPy:
http://www.quantstart.com/articles/LU-Decomposition-in-Python-and-NumPy (browse to the bottom to see more)
 
Back
Top