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 Answer 1

2
$\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$
1
  • $\begingroup$ yes right exactly that's what happened in my case, thanks $\endgroup$ Apr 15, 2019 at 5:27

Your Answer

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

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