Hi out there,

this is the code segment

  if m < maxN and n < maxN and self.activeWide[m+1, n+1]:
                             try:
                                 deltaX = x[m+1] - x[m]
                             except TypeError:
                                 print '-' * 40
                                 print type(x)
                                 type_a, type_b = map(type, (x[m +  
1], x[m]))
                                 print type_a, type_b, type_a is type_b
                                 print '-' * 40
                                 raise

the if-conclusion is TRUE!
I got an error at the line "deltaX = x[m+1] - x[m]", the values of  
these types:


x     : <type 'numpy.ndarray'>
x[m]  : <type 'numpy.float64'>
x[m+1]: <type 'numpy.float64'>
m     : counting variable, i guess an integer?

I just try to subtract x[m] from x[m+1], but I got an error:

Inappropriate argument type.
unsupported operand type(s) for -: 'numpy.float64' and 'numpy.float64'

For more code snippets you can follow these URL:
http://www.python-forum.de/topic-10580.html
It is in german language, but there are more code snippets and some  
tests from me and other users.

The problem is that both variables are definitely from the same type,  
but i cant substract theme. When I go to my python interpreter and  
reproduce the code there is no problem. I think the imports from  
numpy are OK, i cant see the error?

Thanks for any help!
Michael --





_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to