Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeError: 'numpy.float64' object is not callable

Tags:

python

numpy

So, what im trying to do is get certain numbers from certain positions in a array of a given > range and put them into an equation

yy = arange(4)
xx = arange(5)
Area = ((xx[2] - xx[1])(yy[2] + yy[1])) / 2

I try to run it and I get this..

----> ((xx[2] - xx[1])(yy[2] + yy[1])) / 2
TypeError: 'numpy.int64' object is not callable

I get error.. how can I use certain numbers in an array and put them into an equation?

like image 837
user2963265 Avatar asked Nov 07 '13 04:11

user2963265


1 Answers

Python does not follow the same rules as written math. You must explicitly indicate multiplication.

Bad:

(a)(b)

(unless a is a function)

Good:

(a) * (b)
like image 88
Ignacio Vazquez-Abrams Avatar answered Sep 21 '22 04:09

Ignacio Vazquez-Abrams