File: indices.py

package info (click to toggle)
python-numarray 1.5.2-4
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 8,668 kB
  • ctags: 11,384
  • sloc: ansic: 113,864; python: 22,422; makefile: 197; sh: 11
file content (15 lines) | stat: -rw-r--r-- 304 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# sample of indexing behavior
from numarray.ma import *

a = array([1,2,3,4,5], Float)
a[1] = masked
print a
print "------"
for i in range(len(a)):
    print i, a[i]
print "------"
for x in a:
    print x
print "------"
print "filled with masked", filled(a, masked)
print "filled with 0.", filled(a, 0.)