'I am getting a TypeError for unsupported operand type(s) for float64

I am implementing the following code: XMeans Getting an error on the following line:

initial_centers = kmeans_plusplus_initializer(sample, amount_initial_centers).initialize()

The Error is:

...
    dataset_differences[index_center] = numpy.sum(numpy.square(data - center), axis=1).T
TypeError: unsupported operand type(s) for -: 'numpy.dtype[float64]' and 'numpy.dtype[float64]

I also tried other types -- uint8, int64, int32 -- but I am getting the same error.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source