[Numpy-discussion] numpy function error

jonasr jonas.ruebsam@web...
Fri Jun 10 07:24:28 CDT 2011


Hello,
i have the following problem, the following code doesnt work

def f1(x): return self.lgdata[2*i][0]*float(x)+self.lgdata[2*i][1]
def f2(x): return self.lgdata[2*i+1][0]*float(x)+self.lgdata[2*i+1][1]
f1=f1(self.ptdata[i])
2=f2(self.ptdata[i])
t=abs(f1-f2)
deltat.append(t)
temptot.append(f1)
rezipr.append(1/t)
xul , xur = self.ptdata[i]-0.001, self.ptdata[i]+0.001
print xul,xur,f1,f2,"test \n"
verts =[(xul,f1(xul)),(xul,f2(xul)),(xur,f2(xur)),(xur,f1(xur))]

it gives me the following error:

Traceback (most recent call last):
  File
"/usr/lib/python2.7/site-packages/matplotlib/backends/backend_gtk.py", line
265, in key_press_event
    FigureCanvasBase.key_press_event(self, key, guiEvent=event)
  File "/usr/lib/python2.7/site-packages/matplotlib/backend_bases.py", line
1523, in key_press_event
    self.callbacks.process(s, event)
  File "/usr/lib/python2.7/site-packages/matplotlib/cbook.py", line 265, in
process
    proxy(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/matplotlib/cbook.py", line 191, in
__call__
    return mtd(*args, **kwargs)
  File "auswertung.py", line 103, in __call__
    verts =[(xul,f1(xul)),(xul,f2(xul)),(xur,f2(xur)),(xur,f1(xur))]
TypeError: 'numpy.float64' object is not callable

have no idea where the problem is, since ptdata is an 1dim array there
should be no problem to
pass it to a function ? 



-- 
View this message in context: http://old.nabble.com/numpy-function-error-tp31817481p31817481.html
Sent from the Numpy-discussion mailing list archive at Nabble.com.



More information about the NumPy-Discussion mailing list