1234567891011121314 |
- import numpy as np
- def calc_chratios(data,pos_map,start,end):
- view = data[[pos_map.succ_count, pos_map.fail_count, pos_map.commit_count], :]
- view = view[:, start:end]
- all = np.cumsum(view, axis=1)
- succ = all[0, :]
- commit = all[0, :] + all[1, :]
- commit += 0.0000001
- y = succ / commit
- y = y.ravel()
- return int(all[0, -1]), int(all[0, -1] + all[1, -1]), y
|