From 3cce014a39921d694f04ac385c6285014baeeb72 Mon Sep 17 00:00:00 2001 From: Andreas Mayer Date: Sun, 2 Jun 2024 17:10:53 +0100 Subject: [PATCH] nan instead of inf --- pyrepseq/stats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrepseq/stats.py b/pyrepseq/stats.py index 2f36c65..b74e92a 100644 --- a/pyrepseq/stats.py +++ b/pyrepseq/stats.py @@ -171,7 +171,7 @@ def var_chao1(counts): f1 = counts[0] if (len(counts)==1) or (counts[1] == 0): - return np.inf + return np.nan f2 = counts[1] ratio = f1 / f2 return f2 * ((ratio / 4) ** 4 + ratio**3 + (ratio / 2) ** 2)