Reputation: 103
I am working on clustering in python. The package I want to import is
from scipy.spatial.distance import dist
but this is showing the following error.
ImportError: cannot import name 'dist' from 'scipy.spatial.distance' (C:\Users\majid\Anaconda3\lib\site-packages\scipy\spatial\distance.py)
Upvotes: 1
Views: 408
Reputation: 300
Instead of importing dist you need to import pdist or cdist based on your requirement as per the SciPy documentation:
pdist(X[, metric])
Pairwise distances between observations in n-dimensional space.
cdist(XA, XB[, metric])
Compute distance between each pair of the two collections of inputs.
Upvotes: 1