scipy/scipy — pull request #3504 by richardtsai (2014-03-28 02:54:21+00:00)
Title: BUG: cluster.vq.whiten returns nan or inf when std==0

When the standard deviation of a column (feature) of the observations is zero, `vq.whiten` will returns `nan` or `inf`, which will make the kmeans functions work incorrectly. This patch set the zero-std to a small value(1e-20) to avoid `nan` or `inf`. Some test cases for `whiten` are added as well.
This PR fixes #3499.