Skip to content

MNT Remove six imports #15251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions sklearn/neighbors/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 "
Expand All @@ -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 "
Expand Down