fix a problem in samples.py to avoid returning nan when the variance in
a row of data is zero.