How to Solve NameError: name 'distance' is not defined -- scipy

Solution: Import the 'distance' module

To Solve the error, add the following line to the top of your code.

from scipy.spatial import distance

 

For more information:
Python scipy distance