[PYTHON MATRIX-SIG] bug ? problem with =

Jean-Bernard ADDOR jbaddor@phy.ulaval.ca
Sun, 6 Apr 1997 12:14:01 -0400 (EDT)


Python 1.4b3 (Oct 24 1996)  [GCC 2.7.2]
Copyright 1991-1996 Stichting Mathematisch Centrum, Amsterdam

f = open("Y04I0604.CDR",'r')
import array
a = array.array('h')
f.seek(511)
a.fromfile(f,pow(2,13))
f.close()

import Numeric
n = Numeric.array(a)
del a
n.shape = (n.shape[0],1)


def Delta(a, tau):
		r = Numeric.zeros(len(a) - tau)
		for t in range(len(r)):
				diff = a[t+tau] -a[t]
				print t, tau, a[t +tau], a[t], r[t],
n.typecode(), r.typecode(), diff, diff.typecode(), r.shape
				r[t] = diff #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
		return r

def psi(a, q):
		r = Numeric.zeros(len(a) - 2)
		for tau in range(len(r)):
				s = pow(Delta(a,tau +1),q)
				r[tau] = add.reduce(s)/len(s)				
		return r

f = open("Y04I0604.q1", 'w')
f.write(str(psi(n,1)))
f.close()

>>> f =open("Y04I0604.q1", 'w')
>>> f.write(str(psi(n,1)))
0 1 3689 3442 0 l l 247 l (8191,)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
  File "<stdin>", line 4, in psi
  File "<stdin>", line 6, in Delta
TypeError: illegal argument type for built-in operation



	Jean-Bernard



_______________
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________