returns nan only when ValueErrors occur

Identical values will raise a ValueError in kruskal