8000 sparseutils mean_var_axis check for ddof after axis checks · scikit-learn/scikit-learn@46c2540 · GitHub
[go: up one dir, main page]

Skip to content

Commit 46c2540

Browse files
sparseutils mean_var_axis check for ddof after axis checks
1 parent 2b6c217 commit 46c2540

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sklearn/utils/sparsefuncs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,14 @@ def mean_variance_axis(X, axis, ddof=0):
8787
Feature-wise variances
8888
8989
"""
90+
_raise_error_wrong_axis(axis)
91+
9092
if ddof < 0:
9193
raise ValueError('ddof cannot be <0')
9294

9395
if ddof >= X.shape[axis]:
9496
raise ValueError('ddof cannot be <N')
9597

96-
_raise_error_wrong_axis(axis)
97-
9898
if isinstance(X, sp.csr_matrix):
9999
if axis == 0:
100100
return _csr_mean_var_axis0(X, ddof=ddof)

0 commit comments

Comments
 (0)
0