AttributeError in ScientificPython, why?

Uwe Hoffmann becker.hoffmann at comcity-online.de
Fri Jan 5 14:51:44 EST 2001


Hi!

Daniel Reuter wrote:

> I recently installed ScientificPython, hope that someone on this list has
> some experiences with it.
> Now if I enter the following in interactive mode:
> 
> import Scientific.Functions.Derivatives
> import math
> from Scientific.Functions.Derivatives import DerivVar
> print math.sin(DerivVar(2))
> 
> I should, due to the manual get something like this:
> (0.909297426826, [-0.416146836547])
> ...
> ..., something wrong with my imports perhaps?

Your last statement is right! Don't use the math but the Numeric module.

import Scientific.Functions.Derivatives
import Numeric
from Scientific.Functions.Derivatives import DerivVar
print Numeric.sin(DerivVar(2))

Regards,

	Uwe




More information about the Python-list mailing list