Skip to content

Commit 00af6a2

Browse files
committed
FIX: Python 3 support for the neighbors doctests
1 parent b0d2649 commit 00af6a2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/modules/neighbors.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ used:
7777
>>> X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]])
7878
>>> nbrs = NearestNeighbors(n_neighbors=2, algorithm='ball_tree').fit(X)
7979
>>> distances, indices = nbrs.kneighbors(X)
80-
>>> indices
80+
>>> indices # doctest: +ELLIPSIS
8181
array([[0, 1],
8282
[1, 0],
8383
[2, 1],
8484
[3, 4],
8585
[4, 3],
86-
[5, 4]])
86+
[5, 4]]...)
8787
>>> distances
8888
array([[ 0. , 1. ],
8989
[ 0. , 1. ],
@@ -125,13 +125,13 @@ have the same interface; we'll show an example of using the KD Tree here:
125125
>>> import numpy as np
126126
>>> X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]])
127127
>>> kdt = KDTree(X, leaf_size=30, metric='euclidean')
128-
>>> kdt.query(X, k=2, return_distance=False)
128+
>>> kdt.query(X, k=2, return_distance=False) # doctest: +ELLIPSIS
129129
array([[0, 1],
130130
[1, 0],
131131
[2, 1],
132132
[3, 4],
133133
[4, 3],
134-
[5, 4]])
134+
[5, 4]]...)
135135

136136
Refer to the :class:`KDTree` and :class:`BallTree` class documentation
137137
for more information on the options available for neighbors searches,

0 commit comments

Comments
 (0)