[wingide-users] Problem using SciPY

kimwaic888-wingide at yahoo.com kimwaic888-wingide at yahoo.com
Fri Apr 15 18:43:55 EDT 2005


Hello,

I am trying to use the latest SciPY package under the 
latest Python 2.3, Windows XP - fp 2.   If I run it
using IDLE, it works fine.   But WingIDE refuses to
run it - citing:

AttributeError: 'module' object has no attribute
'__eq__'

line 304, in __getattr__ return getattr(module,name),
file ppimport.py.

Here's a no brainer test program I found from the web:

import scipy.linalg.basic

xdata = [5.357, 5.457, 5.797, 5.936, 6.161, 6.697,
6.731, 6.775, 8.442, 9.769, 9.861]
ydata = [0.376, 0.489, 0.874, 1.049, 1.327, 2.054,
2.077, 2.138, 4.744, 7.068, 7.104]
matrix = []

for x in xdata:
    matrix.append([1.0, x, x*x]) # for y = a + bx +
cx^2

coeffs = scipy.linalg.basic.lstsq(matrix, ydata)[0]

print "scipy.linalg.basic.lstsq curve fitting example"
print "fitting data to quadratic equation y = a + bx +
cx^2"

print "yields:  x data     y data    calc value  
error"
for i in range(len(xdata)):
    ycalc = coeffs[0] + coeffs[1] * xdata[i] +
coeffs[2] * xdata[i] * xdata[i]
    error = ycalc - ydata[i]
    print "         % .3f    % .3f      % .3f    %
.3f" % (xdata[i], ydata[i], ycalc, error)
print


--
KC


More information about the wingide-users mailing list