- if len(in_data) > 2:
- win_size = in_data.size if in_data.size < window else window
- results = [0.0, ] * win_size
- median = in_data.rolling(window=win_size).median()
- stdev_t = trimmed_data.rolling(window=win_size, min_periods=2).std()
- m_vals = median.values
- s_vals = stdev_t.values
- d_vals = in_data.values
- for day in range(win_size, in_data.size):
- if np.isnan(m_vals[day - 1]) or np.isnan(s_vals[day - 1]):
+ if len(trimmed_data) > 2:
+ win_size = trimmed_data.size if trimmed_data.size < window else window
+ results = [0.66, ]
+ tmm = trimmed_data.rolling(window=win_size, min_periods=2).median()
+ tmstd = trimmed_data.rolling(window=win_size, min_periods=2).std()
+
+ first = True
+ for build_nr, value in trimmed_data.iteritems():
+ if first:
+ first = False
+ continue
+ if (np.isnan(value)
+ or np.isnan(tmm[build_nr])
+ or np.isnan(tmstd[build_nr])):