Python Forum

Full Version: ValueError: The condensed distance matrix must contain only finite values.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I am learning Python and I have the following code that gives me the following error:

ValueError: The condensed distance matrix must contain only finite values.

The code I have is:

hier_clust = linkage(segmentation_std, method='ward')
This seems to be very simple. I got the code from a course that I took and it works fine for the course data.

However, when I apply it to my own data (~500 data points with no duplication), I got this error. Can someone help?

I searched online and there are others who encountered the same issue. I still couldn't find the solution tho.

Thanks,
Sam
show code in context, include full unmodified error traceback
use code tags