mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-09 03:28:11 +08:00
fix non-finite condition in mean/var calculation (#1381)
This commit is contained in:
@@ -34,6 +34,10 @@ def _mean_var_n(X):
|
|||||||
if fp_err_occurred:
|
if fp_err_occurred:
|
||||||
mean[np.isfinite(mean) == False] = 0 # noqa: E712
|
mean[np.isfinite(mean) == False] = 0 # noqa: E712
|
||||||
v[np.isfinite(v) == False] = 0 # noqa: E712
|
v[np.isfinite(v) == False] = 0 # noqa: E712
|
||||||
|
else:
|
||||||
|
mean[np.isnan(mean)] = 0
|
||||||
|
v[np.isnan(v)] = 0
|
||||||
|
|
||||||
return mean, v, n
|
return mean, v, n
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user