I've isolated a problem in my script that is occurring due to this attempt at a standard deviation calculation using scipy's .tstd function,
sp.stats.tstd(IR)
where my IR
value is 0.0979
. Is there a way to get this to stop (I assume) rounding it to zero? I've tried a suggestion from a previous stackoverflow post that suggested calling the number an np.float64
but that didn't work. Hoping someone has the answer.
Full Error printout:
Traceback (most recent call last):
File "Utt_test.py", line 995, in <module>
X.write(Averaging())
File "Utt_test.py", line 115, in Averaging
IR_sdev=str(round(sp.stats.tstd(IR),4))
File "/usr/lib64/python2.7/site-packages/scipy/stats/stats.py", line 848, in tstd
return np.sqrt(tvar(a,limits,inclusive))
File "/usr/lib64/python2.7/site-packages/scipy/stats/stats.py", line 755, in tvar
return a.var()*(n/(n-1.))
ZeroDivisionError: float division by zero