Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 8fa1e4296360f3be1a3b549c79f675b4 > files > 1027

numpy-1.4.1-6.fc14.x86_64.rpm

>>> import scalar
>>> print scalar.foo.__doc__
foo - Function signature:
  foo(a,b)
Required arguments:
  a : input float
  b : in/output rank-0 array(float,'d')
 
>>> scalar.foo(2,3)   
     A=  2. B=  3.
 INCREMENT A AND B
 NEW A=  3. B=  4.
>>> import Numeric
>>> a=Numeric.array(2)   # these are integer rank-0 arrays
>>> b=Numeric.array(3)
>>> scalar.foo(a,b)
     A=  2. B=  3.
 INCREMENT A AND B
 NEW A=  3. B=  4.
>>> print a,b            # note that only b is changed in situ
2 4