diff --git a/sklearn/neighbors/classification.py b/sklearn/neighbors/classification.py index bb86a7cb5e270..10a14f81db9f3 100644 --- a/sklearn/neighbors/classification.py +++ b/sklearn/neighbors/classification.py @@ -10,7 +10,6 @@ import numpy as np from scipy import stats -from six import string_types from ..utils.extmath import weighted_mode from ..utils.validation import _is_arraylike, _num_samples @@ -423,7 +422,7 @@ def fit(self, X, y): else: if (_is_arraylike(self.outlier_label) and - not isinstance(self.outlier_label, string_types)): + not isinstance(self.outlier_label, str)): if len(self.outlier_label) != len(classes_): raise ValueError("The length of outlier_label: {} is " "inconsistent with the output " @@ -435,7 +434,7 @@ def fit(self, X, y): for classes, label in zip(classes_, outlier_label_): if (_is_arraylike(label) and - not isinstance(label, string_types)): + not isinstance(label, str)): # ensure the outlier lable for each output is a scalar. raise TypeError("The outlier_label of classes {} is " "supposed to be a scalar, got "