8000 STY remove unnecessary variable/operation · scikit-learn/scikit-learn@9cfb506 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9cfb506

Browse files
committed
STY remove unnecessary variable/operation
1 parent d5c57a7 commit 9cfb506

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

sklearn/neighbors/base.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,10 +586,9 @@ def radius_neighbors_graph(self, X, radius=None, mode='connectivity'):
586586
'or "distance" but got %s instead' % mode)
587587

588588
n_neighbors = np.array([len(a) for a in A_ind])
589-
n_nonzero = np.sum(n_neighbors)
590-
if A_data is None:
591-
A_data = np.ones(n_nonzero)
592589
A_ind = np.concatenate(list(A_ind))
590+
if A_data is None:
591+
A_data = np.ones(len(A_ind))
593592
A_indptr = np.concatenate((np.zeros(1, dtype=int),
594593
np.cumsum(n_neighbors)))
595594

0 commit comments

Comments
 (0)
0