From 43b1dc9ade39500b5061fe79533ab5e9d652f200 Mon Sep 17 00:00:00 2001 From: ctokheim Date: Wed, 8 Aug 2018 14:29:48 -0400 Subject: [PATCH] Fixed #1 bug for newer version of numpywhich do not allow a float for instantiating a vector --- src/statistics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/statistics.py b/src/statistics.py index 9039d3f..9d2694d 100644 --- a/src/statistics.py +++ b/src/statistics.py @@ -38,7 +38,7 @@ def bh_fdr(pval): # calculate the needed alpha n = float(len(pval)) - pval_adj = np.zeros(n) + pval_adj = np.zeros(int(n)) i = np.arange(1, n+1, dtype=float)[::-1] # largest to smallest pval_adj = np.minimum(1, cummin(n/i * pval_array[::-1]))[::-1] return pval_adj[original_order]