I call a function with other function as an argument. The other function return numpy.ndarray.
The code:
class CLASS:
def method1(self):
size = 10
return np.zeros([size,size])
def method2(self, method):
res = method()
a = CLASS ()
b = a.method2(a.method1())
The first function throws me TypeError: 'numpy.ndarray' object is not callable
I want to run method2() in the cycle giving different functions as an argument.
QUESTION: Is it any way to run that in Python 3?