Ok this is extremely weird, can someone run this code and see if it crashes with that error?

    import pandas  as pd
    import numpy as np
    from sklearn.covariance import MinCovDet


    dataF=np.array([0.5, 0.1, 0.1, 0.1, 0.957, 0.1, 0.1, 0.1, 0.4285, 0.1])


If I change the array to this

# Working
dataF=np.array([0.5, 0.11, 0.1, 0.1, 0.957, 0.1, 0.1, 0.1, 0.4285, 0.1])

it runs fine. But it seems to crash with any array where there are too many of the same values. This array crashes as well.

# Not working
dataF = np.array([0.5, 0.3, 0.3, 0.3, 0.957, 0.3, 0.3, 0.3, 0.4285, 0.3])

I already checked for NANs and everything, there's nothing.

  • 1
    $\begingroup$ When I run your code, it gives me a Runtime Warning: divide by zero encountered in true_divide and another one RuntimeWarning: invalid value encountered in true_divide and so on. Working through the error message might be useful for finding the reason for this ValueError. $\endgroup$
    – So S
    Commented Oct 3, 2017 at 14:15

1 Answer 1


Well, it seems to be an issue with the library, I opened an issue in gitHub



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.