core dump
Travis Oliphant
olipt at mayo.edu
Wed Oct 6 23:29:24 EDT 1999
The problem is due to an easy-to-make mistake on your part, but it core
dumps because of a bug in Numeric that has been pointed out and patches
have been submitted to fix it two or three times.
N.array can only have a string has a second argument or it core-dumps.
Your two arguments to array should be placed in a tuple and passed as one
argument.
>
> def genPsi(mu1,mu2,n):
> S = genS(mu1,mu2,n)
>
> a = N.dot(S[2,:2],LA.inverse(S[:2,:2]))
> b=N.array(S[0,0],S[1,1])
#### Should be b = N.array((S[0,0],S[1,1]))
>
> return (a,b)
With this fix I get
>>> Psi = genPsi(3,3,6)
>>> print Psi
(array([ 3.058 , 3.1463]), array([ 2.4171, 0.456 ]))
Best,
Travis
More information about the Python-list
mailing list