better filter for nan check

This commit is contained in:
fawce
2012-06-19 20:03:37 -04:00
parent e1db77fb64
commit 89e52c6758
+3 -1
View File
@@ -141,8 +141,10 @@ class RiskMetrics():
'period_label' : period_label
}
# check if a field in rval is nan, and replace it with
# None.
def check_entry(key, value):
if key in {'algo_volatility', 'benchmark_volatility', 'beta'}:
if key != 'period_label':
return np.isnan(value)
else:
return False