Python Forum

Full Version: 'numpy.ndarray' object is not callable
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
distances = np.zeros(points.shape[0])

for i in range(len(distances)):
    distances[i] = distances(p, points[i])
        
Error:
TypeError Traceback (most recent call last) <ipython-input-45-a46653deacff> in <module> 4 #we're going to loop all over the points we have 5 for i in range(len(distances)): ----> 6 distances[i] = distances(p, points[i]) 7 8 TypeError: 'numpy.ndarray' object is not callable
I just wanted to know how to resolve this. Thank you
The error TypeError: 'numpy.ndarray' object is not callable means that you tried to call a numpy array as a function.

distances[i] = distances[p, points[i]]