Skip to content

Commit c457c6a

Browse files
rthqinhanmin2014
authored andcommitted
MNT Remove six imports (scikit-learn#15251)
1 parent a5085da commit c457c6a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

sklearn/neighbors/classification.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
import numpy as np
1212
from scipy import stats
13-
from six import string_types
1413
from ..utils.extmath import weighted_mode
1514
from ..utils.validation import _is_arraylike, _num_samples
1615

@@ -423,7 +422,7 @@ def fit(self, X, y):
423422

424423
else:
425424
if (_is_arraylike(self.outlier_label) and
426-
not isinstance(self.outlier_label, string_types)):
425+
not isinstance(self.outlier_label, str)):
427426
if len(self.outlier_label) != len(classes_):
428427
raise ValueError("The length of outlier_label: {} is "
429428
"inconsistent with the output "
@@ -435,7 +434,7 @@ def fit(self, X, y):
435434

436435
for classes, label in zip(classes_, outlier_label_):
437436
if (_is_arraylike(label) and
438-
not isinstance(label, string_types)):
437+
not isinstance(label, str)):
439438
# ensure the outlier lable for each output is a scalar.
440439
raise TypeError("The outlier_label of classes {} is "
441440
"supposed to be a scalar, got "

0 commit comments

Comments
 (0)