0
$\begingroup$

I am using scipy.spatial.distance.mahalanobis to calculate distance between two vectors but i'm getting null values for some vector I don't know why? null value is possible?

$\endgroup$
1
$\begingroup$

It is important to include your test cases when you encounter a potential bug.

Without further information, looking at the formula of Mahanologis distance. $$\sqrt{(u-v)^TV^{-1}(u-v)}$$ It is possible to obtain an error if $V$ is not positive definite as the input for the square root might be negative.

$\endgroup$
  • $\begingroup$ yes right exactly that's what happened in my case, thanks $\endgroup$ – Milan_Harkhani Apr 15 at 5:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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