~ubuntu-branches/ubuntu/feisty/python-numpy/feisty

« back to all changes in this revision

Viewing changes to numpy/f2py/docs/usersguide/moddata_session.dat

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2006-07-12 10:00:24 UTC
  • Revision ID: james.westby@ubuntu.com-20060712100024-5lw9q2yczlisqcrt
Tags: upstream-0.9.8
ImportĀ upstreamĀ versionĀ 0.9.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
>>> import moddata
 
2
>>> print moddata.mod.__doc__
 
3
i - 'i'-scalar
 
4
x - 'i'-array(4)
 
5
a - 'f'-array(2,3)
 
6
foo - Function signature:
 
7
  foo()
 
8
 
 
9
 
 
10
>>> moddata.mod.i = 5  
 
11
>>> moddata.mod.x[:2] = [1,2]
 
12
>>> moddata.mod.a = [[1,2,3],[4,5,6]]
 
13
>>> moddata.mod.foo()                
 
14
 i=           5
 
15
 x=[           1           2           0           0 ]
 
16
 a=[
 
17
 [   1.000000     ,   2.000000     ,   3.000000     ]
 
18
 [   4.000000     ,   5.000000     ,   6.000000     ]
 
19
 ]
 
20
 Setting a(1,2)=a(1,2)+3
 
21
>>> moddata.mod.a               # a is Fortran-contiguous
 
22
array([[ 1.,  5.,  3.],
 
23
       [ 4.,  5.,  6.]],'f')