[SciPy-user] newbie python & optimization

Gerard Vermeulen gvermeul at grenoble.cnrs.fr
Thu Oct 3 10:47:46 EDT 2002


On Thu, Oct 03, 2002 at 05:16:07AM -0700, Daniel Davidson wrote:
> 
> Im taking a course in fixed income asset pricing and professor *strongly* suggests matlab with optimization, financial toolbox, statistics toolbox and spline toolbox (~$360 ouch). Have following questions:
> 
> * What is probability that Python with scipy will do the trick?
>
100 % (depends on you), you might have to work a little harder,
but you will learn more. Python is a much better language
than MatLab. 
> 
> * Have been reading python and playing. The NumPy pdf docs I read specify a certain behavior for ufuncs, which I see until I import optimize. What causes this and can I use optimize without this happening?:
> 
> >>> from Numeric import *
> >>> a = array(([1,2,3]))
> >>> a*a
> array([1, 4, 9])
> >>> import scipy.optimize
> >>> a*a
> array([0, 0, 0])
> 
I can do: 
[packer at venus packer]$ python
Python 2.2.1 (#1, May  8 2002, 22:31:32)
[GCC 2.96 20000731 (Mandrake Linux 8.2 2.96-0.76mdk)] on linux-i386
Type "help", "copyright", "credits" or "license" for more information.
>>> from Numeric import *
>>> a = array([1,2,3])
>>> a*a
array([1, 4, 9])
>>> from scipy import optimize
>>> a*a
array([1, 4, 9])
>>>

Works fine for me. Without more information (OS, SciPy, Python, ...) nobody
can help you.

Gerard



More information about the SciPy-User mailing list