Skip to content

Commit 4113d9c

Browse files
committed
fix: skip CI computation when cohort size is zero
1 parent e51965a commit 4113d9c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

malariagen_data/anoph/frq_base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ def _add_frequency_ci(*, ds, ci_method):
140140
frq_ci_low, frq_ci_upp = proportion_confint(
141141
count=count, nobs=nobs, method=ci_method
142142
)
143+
loc_zero = nobs == 0
144+
frq_ci_low[loc_zero] = np.nan
145+
frq_ci_upp[loc_zero] = np.nan
143146
ds["event_frequency_ci_low"] = ("variants", "cohorts"), frq_ci_low
144147
ds["event_frequency_ci_upp"] = ("variants", "cohorts"), frq_ci_upp
145148

0 commit comments

Comments
 (0)